You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-25
Original file line number
Diff line number
Diff line change
@@ -37,11 +37,18 @@ Successfully tested with **Angular 7** and its Router, PathLocationStrategy as w
37
37
## Contributions
38
38
- Feel free to file pull requests
39
39
- The closed issues contain some ideas for PRs and enhancements (see labels)
40
+
- If you want to contribute to the docs, you can do so in the `docs-src` folder. Make sure you update `summary.json` as well. Then generate the docs with the following commands:
41
+
42
+
```
43
+
npm install -g @compodoc/compodoc
44
+
npm run docs
45
+
```
40
46
41
47
# Features
42
-
- Logging in via OAuth2 and OpenId Connect (OIDC) Implicit Flow (where a user is redirected to Identity Provider)
48
+
- Logging in via Implicit Flow (where a user is redirected to Identity Provider)
49
+
- Logging in via Code Flow + PKCE
43
50
- "Logging in" via Password Flow (where a user enters their password into the client)
44
-
- Token Refresh for Password Flow by using a Refresh Token
51
+
- Token Refresh for all supported flows
45
52
- Automatically refreshing a token when/some time before it expires
46
53
- Querying Userinfo Endpoint
47
54
- Querying Discovery Document to ease configuration
Since 3.1 you can also automate this task by switching ``sendAccessToken`` on and by setting ``allowedUrls`` to an array with prefixes for the respective URLs. Use lower case for the prefixes.
225
+
You can automate this task by switching ``sendAccessToken`` on and by setting ``allowedUrls`` to an array with prefixes for the respective URLs. Use lower case for the prefixes.
235
226
236
227
```TypeScript
237
228
OAuthModule.forRoot({
@@ -242,11 +233,13 @@ OAuthModule.forRoot({
242
233
})
243
234
```
244
235
236
+
If you need more versatility, you can look in the [documentation](https://manfredsteyer.github.io/angular-oauth2-oidc/docs/additional-documentation/working-with-httpinterceptors.html) how to setup a custom interceptor.
237
+
245
238
## Routing
246
239
247
240
If you use the ``PathLocationStrategy`` (which is on by default) and have a general catch-all-route (``path: '**'``) you should be fine. Otherwise look up the section ``Routing with the HashStrategy`` in the [documentation](https://manfredsteyer.github.io/angular-oauth2-oidc/docs/).
248
241
249
-
## More Documentation
242
+
## More Documentation (!)
250
243
251
244
See the [documentation](https://manfredsteyer.github.io/angular-oauth2-oidc/docs/) for more information about this library.
Since Version 8, this library also supports code flow and [PKCE](https://tools.ietf.org/html/rfc7636) to align with the current draft of the [OAuth 2.0 Security Best Current Practice](https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13) document.
4
+
5
+
6
+
To configure your solution for code flow + PKCE you have to set the `responseType` to `code`:
7
+
8
+
```TypeScript
9
+
10
+
import { AuthConfig } from 'angular-oauth2-oidc';
11
+
12
+
export const authCodeFlowConfig: AuthConfig = {
13
+
// Url of the Identity Provider
14
+
issuer: 'https://demo.identityserver.io',
15
+
16
+
// URL of the SPA to redirect the user to after login
Since Version 8, this library also supports code flow and [PKCE](https://tools.ietf.org/html/rfc7636) to align with the current draft of the [OAuth 2.0 Security Best Current Practice](https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13) document.
4
+
5
+
6
+
To configure your solution for code flow + PKCE you have to set the `responseType` to `code`:
7
+
8
+
```TypeScript
9
+
import { AuthConfig } from'angular-oauth2-oidc';
10
+
11
+
exportconst authCodeFlowConfig:AuthConfig= {
12
+
// Url of the Identity Provider
13
+
issuer: 'https://demo.identityserver.io',
14
+
15
+
// URL of the SPA to redirect the user to after login
If you want to use a custom storage solution, you can extend the `OAuthStorage` class. Documentation can be found [here](../classes/OAuthStorage.html#info). Then add it as a provider, just like in the `localStorage` example above.
The configuration parameter `strictDiscoveryDocumentValidation` is set `true` by default. This ensures that all of the endpoints provided via the ID Provider discovery document share the same base URL as the `issuer` parameter.
4
+
5
+
Several ID Providers (i.e. Google OpenID, WS02-IS, PingOne) provide different domains or path params for various endpoints in the discovery document. These providers may still adhere to the [OpenID Connect Provider Configuration specification](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse), but will fail to pass this library's discovery document validation.
6
+
7
+
To use this library with an ID Provider that does not maintain a consistent base URL across the discovery document endpoints, set the `strictDiscoveryDocumentValidation` parameter to `false` in your configuration:
0 commit comments