Skip to content

Commit e7402ae

Browse files
authored
Merge pull request #154 from FormidableLabs/feature/azure-ad
Feature: Add Azure Active Directory Example
2 parents 8ef0213 + 04db534 commit e7402ae

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ These providers are OpenID compliant, which means you can use [autodiscovery](ht
3131
([Example configuration](#google))
3232
* [Okta](https://developer.okta.com) ([Example configuration](#okta))
3333
* [Keycloak](http://www.keycloak.org/) ([Example configuration](#keycloak))
34+
* [Azure Active Directory](https://docs.microsoft.com/en-us/azure/active-directory) ([Example configuration](#azure-active-directory))
3435

3536
### Tested OAuth2 providers:
3637

@@ -210,7 +211,7 @@ AppAuth supports three options for dependency management.
210211
With [CocoaPods](https://guides.cocoapods.org/using/getting-started.html), add the following line to
211212
your `Podfile`:
212213

213-
pod 'AppAuth', '>= 0.91'
214+
pod 'AppAuth', '>= 0.94'
214215

215216
Then run `pod install`. Note that version 0.91 is the first of the library to support iOS 11.
216217

@@ -585,6 +586,37 @@ const refreshedState = await refresh(config, {
585586
});
586587
```
587588

589+
### Azure Active Directory
590+
591+
Azure Active Directory [does not specify a revocation endpoint](https://docs.microsoft.com/en-us/azure/active-directory/active-directory-configurable-token-lifetimes#access-tokens) because the access token are not revokable. Therefore `revoke` functionality doesn't work.
592+
593+
See the [Azure docs on requesting an access token](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code#request-an-authorization-code) for more info on additional parameters.
594+
595+
Please Note:
596+
* The [Azure docs](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code#request-an-authorization-code) recommend `'urn:ietf:wg:oauth:2.0:oob'` as the `redirectUrl`.
597+
* `Scopes` is ignored.
598+
* `additionalParameters.resource` may be required based on the tenant settings.
599+
600+
```js
601+
const config = {
602+
issuer: 'https://login.microsoftonline.com/your-tenant-id',
603+
clientId: 'your-client-id',
604+
redirectUrl: 'urn:ietf:wg:oauth:2.0:oob',
605+
scopes: [], // ignored by Azure AD
606+
additionalParameters: {
607+
resource: 'your-resource'
608+
}
609+
};
610+
611+
// Log in to get an authentication token
612+
const authState = await authorize(config);
613+
614+
// Refresh token
615+
const refreshedState = await refresh(config, {
616+
refreshToken: authState.refreshToken,
617+
});
618+
```
619+
588620
### Uber
589621

590622
Uber provides an OAuth 2.0 endpoint for logging in with a Uber user's credentials. You'll need to first [create an Uber OAuth application here](https://developer.uber.com/docs/riders/guides/authentication/introduction).

0 commit comments

Comments
 (0)