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
*[Angular Authentication with OpenID Connect and Okta in 20 Minutes](https://developer.okta.com/blog/2017/04/17/angular-authentication-with-oidc)
25
+
*[Add Authentication to Your Angular PWA](https://developer.okta.com/blog/2017/06/13/add-authentication-angular-pwa)
26
+
*[Build an Ionic App with User Authentication](https://developer.okta.com/blog/2017/08/22/build-an-ionic-app-with-user-authentication)
27
+
22
28
## Tested Environment
23
29
24
30
Successfully tested with Angular 4.3+, Angular 5 and its Router,PathLocationStrategy as well as HashLocationStrategy and CommonJS-Bundling via webpack. At server side we've used IdentityServer (.NET/ .NET Core) and Redhat's Keycloak (Java).
25
31
32
+
## New Features in Version 3.1
33
+
34
+
See [Release Notes](https://github.com/manfredsteyer/angular-oauth2-oidc/releases/tag/3.1)
26
35
27
36
## New Features in Version 3.0
28
37
@@ -41,7 +50,7 @@ See [Release Notes](https://github.com/manfredsteyer/angular-oauth2-oidc/release
41
50
- Token Refresh for Implicit Flow by implementing "silent refresh"
42
51
- Validating the signature of the received id_token
43
52
- Providing Events via the observable ``events``.
44
-
- The event ``token_expires`` can be used togehter with a silent refresh to automatically refresh a token when/ before it expires (see also property ``timeoutFactor``).
53
+
- The event ``token_expires`` can be used together with a silent refresh to automatically refresh a token when/ before it expires (see also property ``timeoutFactor``).
45
54
46
55
## Additional Features
47
56
- Logging in via OAuth2 and OpenId Connect (OIDC) Implicit Flow (where user is redirected to Identity Provider)
@@ -188,7 +197,7 @@ export class HomeComponent {
188
197
}
189
198
190
199
publicget name() {
191
-
let claims =this.oAuthService.getIdentityClaims();
200
+
let claims =this.oauthService.getIdentityClaims();
192
201
if (!claims) returnnull;
193
202
returnclaims.given_name;
194
203
}
@@ -218,7 +227,7 @@ The following snippet contains the template for the login page:
218
227
</div>
219
228
```
220
229
221
-
### Skipping the login form
230
+
### Skipping the Login Form
222
231
223
232
If you don't want to display a login form that tells the user that they are redirected to the identity server, you can use the convenince function ``this.oauthService.loadDiscoveryDocumentAndLogin();`` instead of ``this.oauthService.loadDiscoveryDocumentAndTryLogin();`` when setting up the library.
224
233
@@ -235,18 +244,28 @@ var headers = new Headers({
235
244
});
236
245
```
237
246
238
-
If you are using the new HttpClient, use the class HttpHeaders instead:
247
+
If you are using the new ``HttpClient``, use the class ``HttpHeaders`` instead:
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.
246
256
247
-
## Some infos about Routing
257
+
```TypeScript
258
+
OAuthModule.forRoot({
259
+
resourceServer: {
260
+
allowedUrls: ['http://www.angular.at/api'],
261
+
sendAccessToken: true
262
+
}
263
+
})
264
+
```
248
265
266
+
## Routing
249
267
268
+
If you use the ``PathLocationStragegy`` (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 [documation](https://manfredsteyer.github.io/angular-oauth2-oidc/angular-oauth2-oidc/docs/).
0 commit comments