oidc-platform
oidc-platform copied to clipboard
OpenID Connect Identity Platform
OpenID Connect Identity Platform
The synapse OpenID Connect platform uses node-oidc-provider to provide user authentication for our clients' applications. node-oidc-provider is an OpenID Connect provider library. In order to fully understand the ins and outs of this application, understanding OpenID Connect is a must.
Usage Documentation
- Installation
- Implementation
- Screens and Theming
- Installing Themes
- Webhooks
Setting up for development
- Copy
common.template.envascommon.envand provide a mailgun, SES, or sendgrid key - Set the OIDC_DB_* vars based on what RDBMS you are using.
- Run either
./compose-mysql upor./compose-postgres up. You can also just dodocker-compose upwhich will use postgres. - Create an oauth client by posting to http://localhost:9001/op/reg with the following:
Headers:
{
"Content-Type": "application/json",
"Authorization": "Bearer token1", // common.env -> OIDC_INITIAL_ACCESS_TOKEN value
}
Body:
{
"response_types": ["code id_token token"],
"grant_types": [
"authorization_code",
"implicit",
"client_credentials"
],
"redirect_uris": ["https://sso-client.test:3000/"],
"post_logout_redirect_uris": ["https://sso-client.test:3000/logout"]
}
- In
test-client/srccreate a copy ofconfig.template.jsand call itconfig.js. Fill in the client_id and client_secret of the client you created in the previous step. - Add
sso-client.testfor127.0.0.1to your hosts file npm iandnpm startintest-clientandtest-client/test-server
Session Management
Sessions are persisted by default, a user can manually log out by visiting ${prefix}/session/end. The following query parameters should also be sent: id_token_hint is to allow the client to determine which user is logging out, and post_logout_redirect_uri allows the user to be redirected back to the client app.
Clients
Clients can be registered dynamically with the registration endpoint defined in the OICD provider's Hapi plugin. By default this is ${prefix}/reg. Any of the OpenID Client Metadata can be supplied. The Bearer token for this request is validated against the OIDC_INITIAL_ACCESS_TOKEN environment variable. YOU MUST PROVIDE A STRONG TOKEN in production to prevent unauthorized clients from being added.
Releasing
- Ensure you've checked out
masterand that it's up-to-date (or if hotfixing, check out a new branch from a previous release's tag) - Update the version number in
api/package.jsonandapi/package-lock.jsonand commit the changes cd apiif you're in the root of the repodocker build -t synapsestudios/oidc-platform:vX.Y.Z .docker push synapsestudios/oidc-platform:vX.Y.Zgit pushgit tag vX.Y.Z && git push tags- If hotfixing, you can
git push :refs/heads/hotfix-branch-nameto delete the hotfix branch