-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(provider): add Osso SAML provider (#1448)
Co-authored-by: @sbauch
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export default (options) => { | ||
return { | ||
id: 'osso', | ||
name: 'SAML SSO', | ||
type: 'oauth', | ||
version: '2.0', | ||
params: { grant_type: 'authorization_code' }, | ||
accessTokenUrl: `https://${options.domain}/oauth/token`, | ||
authorizationUrl: `https://${options.domain}/oauth/authorize?response_type=code`, | ||
profileUrl: `https://${options.domain}/oauth/me`, | ||
profile: (profile) => { | ||
return { | ||
id: profile.id, | ||
name: profile.name || profile.email, | ||
email: profile.email | ||
} | ||
}, | ||
...options | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
id: osso | ||
title: Osso | ||
--- | ||
|
||
## Documentation | ||
|
||
Osso is an open source service that handles SAML authentication against Identity Providers, normalizes profiles, and makes those profiles available to you in an OAuth 2.0 code grant flow. | ||
|
||
If you don't yet have an Osso instance, you can use [Osso's Demo App](https://demo.ossoapp.com) for your testing purposes. For documentation on deploying an Osso instance, see https://ossoapp.com/docs/deploy/overview/ | ||
|
||
## Configuration | ||
|
||
You can configure your OAuth Clients on your Osso Admin UI, i.e. https://demo.ossoapp.com/admin/config - you'll need to get a Client ID and Secret and allow-list your redirect URIs. | ||
|
||
[SAML SSO differs a bit from OAuth](https://ossoapp.com/blog/saml-vs-oauth) - for every tenant who wants to sign in to your application using SAML, you and your customer need to perform a multi-step configuration in Osso's Admin UI and the admin dashboard of the tenant's Identity Provider. Osso provides documentation for providers like Okta and OneLogin, cloud-based IDPs who also offer a developer account that's useful for testing. Osso also provides a [Mock IDP](https://idp.ossoapp.com) that you can use for testing without needing to sign up for an Identity Provider service. | ||
|
||
See Osso's complete configuration and testing documentation at https://ossoapp.com/docs/configure/overview | ||
|
||
## Example | ||
|
||
A full example application is available at https://github.com/enterprise-oss/osso-next-auth-example and https://nextjs-demo.ossoapp.com | ||
|
||
```js | ||
import Providers from `next-auth/providers` | ||
... | ||
providers: [ | ||
Providers.Osso({ | ||
clientId: process.env.OSSO_CLIENT_ID, | ||
clientSecret: process.env.OSSO_CLIENT_SECRET, | ||
domain: process.env.OSSO_DOMAIN | ||
}) | ||
} | ||
... | ||
``` | ||
|
||
:::note | ||
`domain` should be the fully qualified domain – e.g. `demo.ossoapp.com` | ||
::: |
9594251
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: