Skip to content

Add Config Example for Microsoft Entra ID to Docs #1044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/docs/providers/microsoft-entra-id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Microsoft Entra ID

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.

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.

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

NOTES:

- Microsoft Entra ID does not have a `revocationEndpoint`.
- Application ID can be viewed in your Entra application's dashboard.
- Authorization and Token endpoints can be found under the `Endpoints` link at the top of the page in your Entra application's dashboard.

```js
const config = {
serviceConfiguration: {
authorizationEndpoint: 'https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/authorize',
tokenEndpoint: 'https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/token',
},
clientId: '<APPLICATION_ID>',
redirectUrl: 'com.my-app://oauth/redirect', // 'com.my-app' should correspond to your app name
scopes: ['openid', 'profile', 'email', 'offline_access'],
};

// Log in to get an authentication token
const authState = await authorize(config);

// Refresh token
const refreshedState = await refresh(config, {
refreshToken: authState.refreshToken,
});
```
Loading