Skip to content

Commit 7cdc33d

Browse files
refactor: use aad instead of o365
1 parent 3b1481f commit 7cdc33d

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

docs/content/en/providers/office365.md renamed to docs/content/en/providers/azure-ad.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
2-
title: Office 365
2+
title: Azure AD
33
description: This provider is based on oauth2 scheme and supports all scheme options
44
position: 38
55
category: Providers
66
---
77

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)
99

1010
## Usage
1111

1212
```js
1313
auth: {
1414
strategies: {
15-
o365: {
15+
aad: {
1616
clientId: process.env.AAD_CLIENT_ID,
1717
clientSecret: process.env.AAD_CLIENT_SECRET,
1818
tenantId: process.env.AAD_TENANT_ID,
@@ -25,7 +25,7 @@ auth: {
2525
Anywhere in your application logic:
2626

2727
```js
28-
this.$auth.loginWith('o365')
28+
this.$auth.loginWith('aad')
2929
```
3030

3131
💁 This provider is based on [oauth2 scheme](../schemes/oauth2.md) and supports all scheme options.

src/providers/aad/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
}

src/providers/o365/index.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)