Skip to content

Commit

Permalink
feat(provider): add Osso SAML provider (#1448)
Browse files Browse the repository at this point in the history
Co-authored-by: @sbauch
  • Loading branch information
sbauch committed Mar 5, 2021
1 parent f3e64f0 commit 9594251
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/providers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import MailRu from './mailru'
import Medium from './medium'
import Netlify from './netlify'
import Okta from './okta'
import Osso from './osso'
import Reddit from './reddit'
import Salesforce from './salesforce'
import Slack from './slack'
Expand Down Expand Up @@ -63,6 +64,7 @@ export default {
Medium,
Netlify,
Okta,
Osso,
Reddit,
Salesforce,
Slack,
Expand Down
20 changes: 20 additions & 0 deletions src/providers/osso.js
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
}
}
39 changes: 39 additions & 0 deletions www/docs/providers/osso.md
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`
:::

1 comment on commit 9594251

@vercel
Copy link

@vercel vercel bot commented on 9594251 Mar 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.