Skip to content

Commit ca37836

Browse files
Add documentation for Microsoft SSO (#919)
* docs: Add Microsoft docs * docs: add link to Microsoft docs
1 parent ccd565f commit ca37836

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ These providers are OpenID compliant, which means you can use [autodiscovery](ht
3535
- [Azure Active Directory](https://docs.microsoft.com/en-us/azure/active-directory) ([Example configuration](./docs/config-examples/azure-active-directory.md))
3636
- [AWS Cognito](https://eu-west-1.console.aws.amazon.com/cognito) ([Example configuration](./docs/config-examples/aws-cognito.md))
3737
- [Asgardeo](https://asgardeo.io) ([Example configuration](./docs/config-examples/asgardeo.md))
38+
- [Microsoft](https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc) ([Example configuration](./docs/config-examples/microsoft.md))
3839

3940
## Tested OAuth2 providers
4041

docs/config-examples/microsoft.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Microsoft
2+
3+
1. Supplying "issuer" fails, because Microsoft returns `issuer` with the literal string `https://login.microsoftonline.com/{tenantid}/v2.0` when `https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration` is queried.. We need to manually specify `serviceConfiguration`.
4+
5+
2. `REDIRECT_URL` varies based on platform:
6+
- iOS: msauth.com.example.app://auth/
7+
- Android: com.example.app://msauth/<SIGNATURE_HASH>/
8+
9+
3. Microsoft does not have. revocationEndpoint.
10+
11+
```js
12+
const config = {
13+
serviceConfiguration: {
14+
authorizationEndpoint: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
15+
tokenEndpoint: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
16+
},
17+
clientId: '<APPLICATION_ID>',
18+
redirectUrl: '<REDIRECT_URL>',
19+
scopes: ['openid', 'profile', 'email', 'offline_access'],
20+
};
21+
22+
// Log in to get an authentication token
23+
const authState = await authorize(config);
24+
25+
// Refresh token
26+
const refreshedState = await refresh(config, {
27+
refreshToken: authState.refreshToken,
28+
});
29+
```

0 commit comments

Comments
 (0)