{"id":138289,"date":"2021-03-23T11:03:02","date_gmt":"2021-03-23T11:03:02","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/greenhouse-portal-sso\/"},"modified":"2021-03-23T11:15:58","modified_gmt":"2021-03-23T11:15:58","slug":"greenhouse-portal-sso","status":"publish","type":"plugin","link":"https:\/\/lo.wordpress.org\/plugins\/greenhouse-portal-sso\/","author":18629713,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0","stable_tag":"1.0.0","tested":"5.6.17","requires":"4.9","requires_php":"7.1","requires_plugins":"","header_name":"Greenhouse Portal SSO","header_author":"shane.van.den.bogaard","header_description":"Sign in with your GH Portal account using Authorization Flow.","assets_banners_color":"","last_updated":"2021-03-23 11:15:58","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/gitlab.com\/meh\/wordpress-plugin-gh-portal-sso","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":0,"downloads":949,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation"],"tags":{"1.0.0":{"tag":"1.0.0","author":"ghmeh","date":"2021-03-23 11:15:58"}},"upgrade_notice":[],"ratings":[],"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[197630,33703,602,4538,600],"plugin_category":[38,54],"plugin_contributors":[197631],"plugin_business_model":[],"class_list":["post-138289","plugin","type-plugin","status-publish","hentry","plugin_tags-ghp","plugin_tags-greenhouse","plugin_tags-login","plugin_tags-portal","plugin_tags-security","plugin_category-authentication","plugin_category-security-and-spam-protection","plugin_contributors-ghmeh","plugin_committers-ghmeh"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/greenhouse-portal-sso.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin allows to authenticate users against GH Portal API with Authorization Flow.\nOnce installed, it can be configured to automatically authenticate users (SSO). After consent has been obtained, an existing user is automatically logged into WordPress, while\nnew users are created in WordPress database.<\/p>\n\n<h3>Plugin flow explained<\/h3>\n\n<p>When a user of your WordPress application visits one of your public pages, a check is done if a user session is currently set. When <code>GH_Portal_SSO_Option_Settings::enforce_privacy<\/code> is set to <code>TRUE<\/code>, the plugin will redirect the user from the public page to the Greenhouse Portal SSO page incase no active session was found. The default WordPress authorization check if performed when accessing any of the <code>wp-admin<\/code> pages. This also allows to user to sign-in using either the Greenhouse account of their existing WordPress acount.<\/p>\n\n<p>The following applies to any non wp-admin page request incase no user session is found:<\/p>\n\n<p>The user will be redirected from the current page to the Greenhouse Portal, which acts a proxy between Auth0's management system and Greenhouse's Microsoft Identity (OpenID Connect) accounts, to perform it's authentication through SSO.<\/p>\n\n<p>A success SSO using the Greenhouse Portal results in an active access token that's short lived (8 hours). The access token can be used to retrieve data on behalf of the user to which he\/she has given consent.<\/p>\n\n<p>The request for a redirect to the Greenhouse Portal requires a <code>redirect_uri<\/code> as one of its query parameter. This is the URL to which the proxy should return the user's access token. By default, the redirect URL is set to <code>admin-ajax.php<\/code> in conjuction with <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/admin_url\/\">admin_url<\/a> and uses <a href=\"https:\/\/codex.wordpress.org\/AJAX_in_Plugins\">WordPress' AJAX API<\/a> to further handle the redirect flow.<\/p>\n\n<pre><code>`\n<\/code><\/pre>\n\n<p>Temperary Redirect\nLocation:\n  https:\/\/authorize.my.greenhousegroup.com\/authorize<\/p>\n\n<p>redirect_uri=&lt;redirect\/callback URL&gt;\n    `<\/p>\n\n<p>The above URL will initiate a SSO request to Auth0. Once the user has signed in, the Greenhouse Portal will redirect the user to the given URL in the <code>redirect_uri<\/code> query parameter. The access token is passed through as a query parameter to the redirect url (e.g. <code>?GHP_authorization_token=xxxxxxxxxxxx<\/code>).<\/p>\n\n<p>On successfull redirect, the access token is fetched from the query parameters. An additional request is made to the Greenhouse API to fetch the Greenhouse user information from the retrieved access token.<\/p>\n\n<pre><code>`\n<\/code><\/pre>\n\n<p>POST \/ HTTP\/1.1\nHost:\n  https:\/\/api.my.greenhousegroup.com\/user<\/p>\n\n<p>Headers:\n  Authorization=\n  x-api-version=\n    `<\/p>\n\n<p>The Greenhouse user information is used to find an existing WordPress user. When no WordPress user was found, a new one can be automatically created when <code>GH_Portal_SSO_Option_Settings::create_if_does_not_exist<\/code> is set to <code>TRUE<\/code> on successfull sign-in.<\/p>\n\n<p>After finding\/creating the WordPress user, a session of 8 hours is created, the duration can be set by <code>GH_Portal_SSO_Option_Settings::expires_in<\/code> using a numeric measured in seconds.<\/p>\n\n<p>When no WordPress user account was found or can not be created, the user is redirected to the wp-admin sign-in page with the approriate error message (if any).<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install from plugins page by name (Greenhouse Portal SSO) OR upload to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin<\/li>\n<li>Configure the <a href=\".\/includes\/gh-portal-sso-option-settings.php\">plugin settings<\/a> to meet your needs<\/li>\n<\/ol>","raw_excerpt":"A client plugin that provides SSO (Single-Sign-on) or opt-in authentication against Greenhouse Portal Auth0 implementation.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/138289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=138289"}],"author":[{"embeddable":true,"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/ghmeh"}],"wp:attachment":[{"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=138289"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=138289"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=138289"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=138289"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=138289"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/lo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=138289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}