Skip to content

Commit 18b33e2

Browse files
Add asgardeo to the list of tested OpenID providers (#882)
* Add asgardeo to the list of tested openid providers * chore: added changeset --------- Co-authored-by: Rob Walker <hi@robwalker.co>
1 parent e84adf6 commit 18b33e2

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

.changeset/yellow-turkeys-hope.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-app-auth': patch
3+
---
4+
5+
Added Asgardeo configuration example

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ These providers are OpenID compliant, which means you can use [autodiscovery](ht
3434
- [Keycloak](http://www.keycloak.org/) ([Example configuration](./docs/config-examples/keycloak.md))
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))
37+
- [Asgardeo](https://asgardeo.io) ([Example configuration](./docs/config-examples/asgardeo.md))
3738

3839
### Tested OAuth2 providers
3940

docs/config-examples/asgardeo.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
To add authentication to your app using Asgardeo, you will first need to [create an application](https://wso2.com/asgardeo/docs/guides/applications/register-mobile-app/) in the Asgardeo console. If you don't have an Asgardeo account, [you can signup for one free](https://asgardeo.io/signup).
2+
3+
After creating an application, take note of the configuration values listed in the **Quick Start** and **Info** tabs. You will be using those values as follows.
4+
5+
```js
6+
export const config = {
7+
issuer: 'https://api.asgardeo.io/t/<your_org_name>/oauth2/token',
8+
clientId: '<your_application_id>',
9+
redirectUrl: '<your_appAuthRedirectScheme>://example',
10+
scopes: ['openid', 'profile']
11+
};
12+
13+
// Log in to get an authentication token
14+
const authState = await authorize(config);
15+
16+
// Refresh token
17+
const refreshedState = await refresh(config, {
18+
refreshToken: authState.refreshToken,
19+
});
20+
21+
// Revoke token
22+
await revoke(config, {
23+
tokenToRevoke: refreshedState.refreshToken
24+
});
25+
26+
// End session
27+
await logout(config, {
28+
idToken: authState.idToken,
29+
postLogoutRedirectUrl: '<your_appAuthRedirectScheme>:/logout'
30+
});
31+
```

0 commit comments

Comments
 (0)