Skip to content

Commit 404ab2c

Browse files
authored
Add Config Example for Microsoft Entra ID to Docs (#1044)
1 parent 3530c7d commit 404ab2c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Microsoft Entra ID
2+
3+
If you're using Microsoft Identity platform and want to add App Auth to your React Native application, you'll need an Entra application to authorize against.
4+
5+
Microsoft offers mupltiple different PLatform configurations you could setup for your application. In this example, we are using the `Mobile and desktop applications` platform configuration.
6+
7+
You can find detailed instructions on registering a new Entra application [here](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate).
8+
9+
NOTES:
10+
11+
- Microsoft Entra ID does not have a `revocationEndpoint`.
12+
- Application ID can be viewed in your Entra application's dashboard.
13+
- Authorization and Token endpoints can be found under the `Endpoints` link at the top of the page in your Entra application's dashboard.
14+
15+
```js
16+
const config = {
17+
serviceConfiguration: {
18+
authorizationEndpoint: 'https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/authorize',
19+
tokenEndpoint: 'https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/token',
20+
},
21+
clientId: '<APPLICATION_ID>',
22+
redirectUrl: 'com.my-app://oauth/redirect', // 'com.my-app' should correspond to your app name
23+
scopes: ['openid', 'profile', 'email', 'offline_access'],
24+
};
25+
26+
// Log in to get an authentication token
27+
const authState = await authorize(config);
28+
29+
// Refresh token
30+
const refreshedState = await refresh(config, {
31+
refreshToken: authState.refreshToken,
32+
});
33+
```

0 commit comments

Comments
 (0)