File tree Expand file tree Collapse file tree 3 files changed +21
-17
lines changed
docs/content/en/providers Expand file tree Collapse file tree 3 files changed +21
-17
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- title : Office 365
2
+ title : Azure AD
3
3
description : This provider is based on oauth2 scheme and supports all scheme options
4
4
position : 38
5
5
category : Providers
6
6
---
7
7
8
- [ Source Code] ( https://github.com/nuxt-community/auth-module/blob/dev/src/providers/o365 /index.ts )
8
+ [ Source Code] ( https://github.com/nuxt-community/auth-module/blob/dev/src/providers/aad /index.ts )
9
9
10
10
## Usage
11
11
12
12
``` js
13
13
auth: {
14
14
strategies: {
15
- o365 : {
15
+ aad : {
16
16
clientId: process .env .AAD_CLIENT_ID ,
17
17
clientSecret: process .env .AAD_CLIENT_SECRET ,
18
18
tenantId: process .env .AAD_TENANT_ID ,
@@ -25,7 +25,7 @@ auth: {
25
25
Anywhere in your application logic:
26
26
27
27
``` js
28
- this .$auth .loginWith (' o365 ' )
28
+ this .$auth .loginWith (' aad ' )
29
29
```
30
30
31
31
💁 This provider is based on [ oauth2 scheme] ( ../schemes/oauth2.md ) and supports all scheme options.
Original file line number Diff line number Diff line change
1
+ import { assignDefaults , addAuthorize } from '../../utils/provider'
2
+
3
+ export default function aad ( nuxt , strategy ) {
4
+ assignDefaults ( strategy , {
5
+ scheme : 'oauth2' ,
6
+ endpoints : {
7
+ authorization : `https://login.microsoftonline.com/${ strategy . tenantId } /oauth2/v2.0/authorize` ,
8
+ userInfo : 'https://graph.microsoft.com/v1.0/me' ,
9
+ token : `https://login.microsoftonline.com/${ strategy . tenantId } /oauth2/v2.0/token`
10
+ } ,
11
+ codeChallengeMethod : 'S256' ,
12
+ scope : [ 'openid' , 'profile' ] ,
13
+ autoLogout : true
14
+ } )
15
+
16
+ addAuthorize ( nuxt , strategy )
17
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments