Title: Greenhouse Portal SSO
Author: ghmeh
Published: <strong>23 Meɣres 2021</strong>
Last modified: 23 Meɣres 2021

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/greenhouse-portal-sso.svg)

# Greenhouse Portal SSO

 By [ghmeh](https://profiles.wordpress.org/ghmeh/)

[Download](https://downloads.wordpress.org/plugin/greenhouse-portal-sso.1.0.0.zip)

 * [Details](https://kab.wordpress.org/plugins/greenhouse-portal-sso/#description)
 * [Reviews](https://kab.wordpress.org/plugins/greenhouse-portal-sso/#reviews)
 *  [Installation](https://kab.wordpress.org/plugins/greenhouse-portal-sso/#installation)
 * [Development](https://kab.wordpress.org/plugins/greenhouse-portal-sso/#developers)

 [Support](https://wordpress.org/support/plugin/greenhouse-portal-sso/)

## Description

This plugin allows to authenticate users against GH Portal API with Authorization
Flow.
 Once installed, it can be configured to automatically authenticate users (
SSO). After consent has been obtained, an existing user is automatically logged 
into WordPress, while new users are created in WordPress database.

### Plugin flow explained

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 `GH_Portal_SSO_Option_Settings::
enforce_privacy` is set to `TRUE`, 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 `wp-admin` 
pages. This also allows to user to sign-in using either the Greenhouse account of
their existing WordPress acount.

The following applies to any non wp-admin page request incase no user session is
found:

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.

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.

The request for a redirect to the Greenhouse Portal requires a `redirect_uri` 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 `admin-ajax.php` in 
conjuction with [admin_url](https://developer.wordpress.org/reference/functions/admin_url/)
and uses [WordPress’ AJAX API](https://codex.wordpress.org/AJAX_in_Plugins) to further
handle the redirect flow.

    ```
    `
    ```

Temperary Redirect
 Location: https://authorize.my.greenhousegroup.com/authorize

redirect_uri=<redirect/callback URL>
 `

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 `redirect_uri`
query parameter. The access token is passed through as a query parameter to the 
redirect url (e.g. `?GHP_authorization_token=xxxxxxxxxxxx`).

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.

    ```
    `
    ```

POST / HTTP/1.1
 Host: https://api.my.greenhousegroup.com/user

Headers:
 Authorization= x-api-version= `

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 `GH_Portal_SSO_Option_Settings::
create_if_does_not_exist` is set to `TRUE` on successfull sign-in.

After finding/creating the WordPress user, a session of 8 hours is created, the 
duration can be set by `GH_Portal_SSO_Option_Settings::expires_in` using a numeric
measured in seconds.

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).

## Installation

 1. Install from plugins page by name (Greenhouse Portal SSO) OR upload to the `/wp-
    content/plugins/` directory
 2. Activate the plugin
 3. Configure the [plugin settings](https://kab.wordpress.org/plugins/greenhouse-portal-sso/./includes/gh-portal-sso-option-settings.php?output_format=md)
    to meet your needs

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Greenhouse Portal SSO” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ ghmeh ](https://profiles.wordpress.org/ghmeh/)

[Translate “Greenhouse Portal SSO” into your language.](https://translate.wordpress.org/projects/wp-plugins/greenhouse-portal-sso)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/greenhouse-portal-sso/),
check out the [SVN repository](https://plugins.svn.wordpress.org/greenhouse-portal-sso/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/greenhouse-portal-sso/)
by [RSS](https://plugins.trac.wordpress.org/log/greenhouse-portal-sso/?limit=100&mode=stop_on_copy&format=rss).

## Meta

 *  Version **1.0.0**
 *  Last updated **6 n iseggasen ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 4.9 or higher **
 *  Tested up to **5.6.22**
 *  PHP version ** 7.1 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/greenhouse-portal-sso/)
 * Tags
 * [greenhouse](https://kab.wordpress.org/plugins/tags/greenhouse/)[login](https://kab.wordpress.org/plugins/tags/login/)
   [portal](https://kab.wordpress.org/plugins/tags/portal/)[security](https://kab.wordpress.org/plugins/tags/security/)
 *  [Advanced View](https://kab.wordpress.org/plugins/greenhouse-portal-sso/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/greenhouse-portal-sso/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/greenhouse-portal-sso/reviews/)

## Contributors

 *   [ ghmeh ](https://profiles.wordpress.org/ghmeh/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/greenhouse-portal-sso/)