Skip to content

Commit 9594251

Browse files
authored
feat(provider): add Osso SAML provider (#1448)
Co-authored-by: @sbauch
1 parent f3e64f0 commit 9594251

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

src/providers/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import MailRu from './mailru'
2525
import Medium from './medium'
2626
import Netlify from './netlify'
2727
import Okta from './okta'
28+
import Osso from './osso'
2829
import Reddit from './reddit'
2930
import Salesforce from './salesforce'
3031
import Slack from './slack'
@@ -63,6 +64,7 @@ export default {
6364
Medium,
6465
Netlify,
6566
Okta,
67+
Osso,
6668
Reddit,
6769
Salesforce,
6870
Slack,

src/providers/osso.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export default (options) => {
2+
return {
3+
id: 'osso',
4+
name: 'SAML SSO',
5+
type: 'oauth',
6+
version: '2.0',
7+
params: { grant_type: 'authorization_code' },
8+
accessTokenUrl: `https://${options.domain}/oauth/token`,
9+
authorizationUrl: `https://${options.domain}/oauth/authorize?response_type=code`,
10+
profileUrl: `https://${options.domain}/oauth/me`,
11+
profile: (profile) => {
12+
return {
13+
id: profile.id,
14+
name: profile.name || profile.email,
15+
email: profile.email
16+
}
17+
},
18+
...options
19+
}
20+
}

www/docs/providers/osso.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
id: osso
3+
title: Osso
4+
---
5+
6+
## Documentation
7+
8+
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.
9+
10+
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/
11+
12+
## Configuration
13+
14+
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.
15+
16+
[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.
17+
18+
See Osso's complete configuration and testing documentation at https://ossoapp.com/docs/configure/overview
19+
20+
## Example
21+
22+
A full example application is available at https://github.com/enterprise-oss/osso-next-auth-example and https://nextjs-demo.ossoapp.com
23+
24+
```js
25+
import Providers from `next-auth/providers`
26+
...
27+
providers: [
28+
Providers.Osso({
29+
clientId: process.env.OSSO_CLIENT_ID,
30+
clientSecret: process.env.OSSO_CLIENT_SECRET,
31+
domain: process.env.OSSO_DOMAIN
32+
})
33+
}
34+
...
35+
```
36+
37+
:::note
38+
`domain` should be the fully qualified domain – e.g. `demo.ossoapp.com`
39+
:::

0 commit comments

Comments
 (0)