-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(providers): add OneLogin (#2345)
Co-authored-by: Lluis Agusti <[email protected]>
- Loading branch information
1 parent
d595857
commit 2155c93
Showing
4 changed files
with
59 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export default function OneLogin(options) { | ||
return { | ||
id: "onelogin", | ||
name: "OneLogin", | ||
type: "oauth", | ||
version: "2.0", | ||
scope: "openid profile name email", | ||
params: { grant_type: "authorization_code" }, | ||
// These will be different depending on the Org. | ||
accessTokenUrl: `https://${options.domain}/oidc/2/token`, | ||
requestTokenUrl: `https://${options.domain}/oidc/2/auth`, | ||
authorizationUrl: `https://${options.domain}/oidc/2/auth?response_type=code`, | ||
profileUrl: `https://${options.domain}/oidc/2/me`, | ||
profile(profile) { | ||
return { ...profile, id: profile.sub } | ||
}, | ||
...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
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,31 @@ | ||
--- | ||
id: onelogin | ||
title: OneLogin | ||
--- | ||
|
||
## Documentation | ||
|
||
https://developers.onelogin.com/openid-connect | ||
|
||
## Options | ||
|
||
The **OneLogin Provider** comes with a set of default options: | ||
|
||
- [OneLogin Provider options](https://github.com/nextauthjs/next-auth/blob/main/src/providers/onelogin.js) | ||
|
||
You can override any of the options to suit your own use case. | ||
|
||
## Example | ||
|
||
```js | ||
import Providers from `next-auth/providers` | ||
... | ||
providers: [ | ||
Providers.OneLogin({ | ||
clientId: process.env.ONELOGIN_CLIENT_ID, | ||
clientSecret: process.env.ONELOGIN_CLIENT_SECRET, | ||
domain: process.env.ONELOGIN_DOMAIN | ||
}) | ||
] | ||
... | ||
``` |
2155c93
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: