File tree Expand file tree Collapse file tree 4 files changed +59
-1
lines changed Expand file tree Collapse file tree 4 files changed +59
-1
lines changed Original file line number Diff line number Diff line change 1+ export default function OneLogin ( options ) {
2+ return {
3+ id : "onelogin" ,
4+ name : "OneLogin" ,
5+ type : "oauth" ,
6+ version : "2.0" ,
7+ scope : "openid profile name email" ,
8+ params : { grant_type : "authorization_code" } ,
9+ // These will be different depending on the Org.
10+ accessTokenUrl : `https://${ options . domain } /oidc/2/token` ,
11+ requestTokenUrl : `https://${ options . domain } /oidc/2/auth` ,
12+ authorizationUrl : `https://${ options . domain } /oidc/2/auth?response_type=code` ,
13+ profileUrl : `https://${ options . domain } /oidc/2/me` ,
14+ profile ( profile ) {
15+ return { ...profile , id : profile . sub }
16+ } ,
17+ ...options ,
18+ }
19+ }
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ export type OAuthProviderType =
8888 | "Naver"
8989 | "Netlify"
9090 | "Okta"
91+ | "OneLogin"
9192 | "Osso"
9293 | "Reddit"
9394 | "Salesforce"
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ Providers.Credentials({
3333 type : "password" ,
3434 } ,
3535 } ,
36- authorize : async ( { username, password} ) => {
36+ authorize : async ( { username, password } ) => {
3737 const user = {
3838 /* fetched user */
3939 }
@@ -152,6 +152,13 @@ Providers.Okta({
152152 domain : "https://foo.auth0.com" ,
153153} )
154154
155+ // $ExpectType OAuthConfig<Profile>
156+ Providers . OneLogin ( {
157+ clientId : "foo123" ,
158+ clientSecret : "bar123" ,
159+ domain : "foo.onelogin.com" ,
160+ } )
161+
155162// $ExpectType OAuthConfig<Profile>
156163Providers . BattleNet ( {
157164 clientId : "foo123" ,
Original file line number Diff line number Diff line change 1+ ---
2+ id : onelogin
3+ title : OneLogin
4+ ---
5+
6+ ## Documentation
7+
8+ https://developers.onelogin.com/openid-connect
9+
10+ ## Options
11+
12+ The ** OneLogin Provider** comes with a set of default options:
13+
14+ - [ OneLogin Provider options] ( https://github.com/nextauthjs/next-auth/blob/main/src/providers/onelogin.js )
15+
16+ You can override any of the options to suit your own use case.
17+
18+ ## Example
19+
20+ ``` js
21+ import Providers from ` next-auth/providers`
22+ ...
23+ providers: [
24+ Providers .OneLogin ({
25+ clientId: process .env .ONELOGIN_CLIENT_ID ,
26+ clientSecret: process .env .ONELOGIN_CLIENT_SECRET ,
27+ domain: process .env .ONELOGIN_DOMAIN
28+ })
29+ ]
30+ ...
31+ ```
You can’t perform that action at this time.
0 commit comments