Skip to content

Commit 5342f2a

Browse files
committed
3.1
1 parent dd1b4f4 commit 5342f2a

File tree

61 files changed

+7695
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+7695
-121
lines changed

README.MD

+28-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ https://manfredsteyer.github.io/angular-oauth2-oidc/angular-oauth2-oidc/docs/
2929

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

32+
## New Features in Version 3.1
33+
34+
35+
3236
## New Features in Version 3.0
3337

3438
See [Release Notes](https://github.com/manfredsteyer/angular-oauth2-oidc/releases/tag/3.0.1)
@@ -223,6 +227,13 @@ The following snippet contains the template for the login page:
223227
</div>
224228
```
225229

230+
### Skipping the Login Form
231+
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.
233+
234+
This directly redirects the user to the identity server if there are no valid tokens.
235+
236+
226237
### Calling a Web API with an Access Token
227238

228239
Pass this Header to the used method of the ``Http``-Service within an Instance of the class ``Headers``:
@@ -233,14 +244,30 @@ var headers = new Headers({
233244
});
234245
```
235246

236-
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:
237248

238249
```TypeScript
239250
var headers = new HttpHeaders({
240251
"Authorization": "Bearer " + this.oauthService.getAccessToken()
241252
});
242253
```
243254

255+
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.
256+
257+
```TypeScript
258+
OAuthModule.forRoot({
259+
resourceServer: {
260+
allowedUrls: ['http://www.angular.at/api'],
261+
sendAccessToken: true
262+
}
263+
})
264+
```
265+
266+
## Routing
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/).
269+
270+
244271
## More Documentation
245272

246273
See the [documentation](https://manfredsteyer.github.io/angular-oauth2-oidc/angular-oauth2-oidc/docs/) for more information about this library.

angular-oauth2-oidc/README.MD

+13
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,13 @@ The following snippet contains the template for the login page:
218218
</div>
219219
```
220220

221+
### Skipping the login form
222+
223+
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+
225+
This directly redirects the user to the identity server if there are no valid tokens.
226+
227+
221228
### Calling a Web API with an Access Token
222229

223230
Pass this Header to the used method of the ``Http``-Service within an Instance of the class ``Headers``:
@@ -236,6 +243,12 @@ var headers = new HttpHeaders({
236243
});
237244
```
238245

246+
247+
## Some infos about Routing
248+
249+
250+
251+
239252
## More Documentation
240253

241254
See the [documentation](https://manfredsteyer.github.io/angular-oauth2-oidc/angular-oauth2-oidc/docs/) for more information about this library.

angular-oauth2-oidc/docs/additional-documentation/callback-after-login.html

+62
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
<li class="link ">
7777
<a href="../additional-documentation/refreshing-a-token-(silent-refresh).html" >Refreshing a Token (Silent Refresh)</a>
7878
</li>
79+
<li class="link ">
80+
<a href="../additional-documentation/working-with-httpinterceptors.html" >Working with HttpInterceptors</a>
81+
</li>
7982
<li class="link ">
8083
<a href="../additional-documentation/callback-after-login.html" data-type="entity-link" class="active" >Callback after login</a>
8184
</li>
@@ -165,6 +168,18 @@
165168
<li class="link">
166169
<a href="../classes/OAuthInfoEvent.html" >OAuthInfoEvent</a>
167170
</li>
171+
<li class="link">
172+
<a href="../classes/OAuthModuleConfig.html" >OAuthModuleConfig</a>
173+
</li>
174+
<li class="link">
175+
<a href="../classes/OAuthNoopResourceServerErrorHandler.html" >OAuthNoopResourceServerErrorHandler</a>
176+
</li>
177+
<li class="link">
178+
<a href="../classes/OAuthResourceServerConfig.html" >OAuthResourceServerConfig</a>
179+
</li>
180+
<li class="link">
181+
<a href="../classes/OAuthResourceServerErrorHandler.html" >OAuthResourceServerErrorHandler</a>
182+
</li>
168183
<li class="link">
169184
<a href="../classes/OAuthStorage.html" >OAuthStorage</a>
170185
</li>
@@ -200,6 +215,22 @@
200215
</ul>
201216
</li>
202217

218+
<li class="chapter">
219+
<div class="simple menu-toggler" data-toggle="collapse"
220+
data-target="#xs-interceptors-links"
221+
>
222+
<span class="fa fa-exchange"></span>
223+
<span>Interceptors</span>
224+
<span class="fa fa-angle-down"></span>
225+
</div>
226+
<ul class="links collapse "
227+
id="xs-interceptors-links"
228+
>
229+
<li class="link">
230+
<a href="../interceptors/DefaultOAuthInterceptor.html" >DefaultOAuthInterceptor</a>
231+
</li>
232+
</ul>
233+
</li>
203234

204235
<li class="chapter">
205236
<div class="simple menu-toggler" data-toggle="collapse"
@@ -323,6 +354,9 @@
323354
<li class="link ">
324355
<a href="../additional-documentation/refreshing-a-token-(silent-refresh).html" >Refreshing a Token (Silent Refresh)</a>
325356
</li>
357+
<li class="link ">
358+
<a href="../additional-documentation/working-with-httpinterceptors.html" >Working with HttpInterceptors</a>
359+
</li>
326360
<li class="link ">
327361
<a href="../additional-documentation/callback-after-login.html" data-type="entity-link" class="active" >Callback after login</a>
328362
</li>
@@ -412,6 +446,18 @@
412446
<li class="link">
413447
<a href="../classes/OAuthInfoEvent.html" >OAuthInfoEvent</a>
414448
</li>
449+
<li class="link">
450+
<a href="../classes/OAuthModuleConfig.html" >OAuthModuleConfig</a>
451+
</li>
452+
<li class="link">
453+
<a href="../classes/OAuthNoopResourceServerErrorHandler.html" >OAuthNoopResourceServerErrorHandler</a>
454+
</li>
455+
<li class="link">
456+
<a href="../classes/OAuthResourceServerConfig.html" >OAuthResourceServerConfig</a>
457+
</li>
458+
<li class="link">
459+
<a href="../classes/OAuthResourceServerErrorHandler.html" >OAuthResourceServerErrorHandler</a>
460+
</li>
415461
<li class="link">
416462
<a href="../classes/OAuthStorage.html" >OAuthStorage</a>
417463
</li>
@@ -447,6 +493,22 @@
447493
</ul>
448494
</li>
449495

496+
<li class="chapter">
497+
<div class="simple menu-toggler" data-toggle="collapse"
498+
data-target="#interceptors-links"
499+
>
500+
<span class="fa fa-exchange"></span>
501+
<span>Interceptors</span>
502+
<span class="fa fa-angle-down"></span>
503+
</div>
504+
<ul class="links collapse "
505+
id="interceptors-links"
506+
>
507+
<li class="link">
508+
<a href="../interceptors/DefaultOAuthInterceptor.html" >DefaultOAuthInterceptor</a>
509+
</li>
510+
</ul>
511+
</li>
450512

451513
<li class="chapter">
452514
<div class="simple menu-toggler" data-toggle="collapse"

angular-oauth2-oidc/docs/additional-documentation/configure-library-for-implicit-flow-without-discovery-document.html

+62
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
<li class="link ">
7777
<a href="../additional-documentation/refreshing-a-token-(silent-refresh).html" >Refreshing a Token (Silent Refresh)</a>
7878
</li>
79+
<li class="link ">
80+
<a href="../additional-documentation/working-with-httpinterceptors.html" >Working with HttpInterceptors</a>
81+
</li>
7982
<li class="link ">
8083
<a href="../additional-documentation/callback-after-login.html" >Callback after login</a>
8184
</li>
@@ -165,6 +168,18 @@
165168
<li class="link">
166169
<a href="../classes/OAuthInfoEvent.html" >OAuthInfoEvent</a>
167170
</li>
171+
<li class="link">
172+
<a href="../classes/OAuthModuleConfig.html" >OAuthModuleConfig</a>
173+
</li>
174+
<li class="link">
175+
<a href="../classes/OAuthNoopResourceServerErrorHandler.html" >OAuthNoopResourceServerErrorHandler</a>
176+
</li>
177+
<li class="link">
178+
<a href="../classes/OAuthResourceServerConfig.html" >OAuthResourceServerConfig</a>
179+
</li>
180+
<li class="link">
181+
<a href="../classes/OAuthResourceServerErrorHandler.html" >OAuthResourceServerErrorHandler</a>
182+
</li>
168183
<li class="link">
169184
<a href="../classes/OAuthStorage.html" >OAuthStorage</a>
170185
</li>
@@ -200,6 +215,22 @@
200215
</ul>
201216
</li>
202217

218+
<li class="chapter">
219+
<div class="simple menu-toggler" data-toggle="collapse"
220+
data-target="#xs-interceptors-links"
221+
>
222+
<span class="fa fa-exchange"></span>
223+
<span>Interceptors</span>
224+
<span class="fa fa-angle-down"></span>
225+
</div>
226+
<ul class="links collapse "
227+
id="xs-interceptors-links"
228+
>
229+
<li class="link">
230+
<a href="../interceptors/DefaultOAuthInterceptor.html" >DefaultOAuthInterceptor</a>
231+
</li>
232+
</ul>
233+
</li>
203234

204235
<li class="chapter">
205236
<div class="simple menu-toggler" data-toggle="collapse"
@@ -323,6 +354,9 @@
323354
<li class="link ">
324355
<a href="../additional-documentation/refreshing-a-token-(silent-refresh).html" >Refreshing a Token (Silent Refresh)</a>
325356
</li>
357+
<li class="link ">
358+
<a href="../additional-documentation/working-with-httpinterceptors.html" >Working with HttpInterceptors</a>
359+
</li>
326360
<li class="link ">
327361
<a href="../additional-documentation/callback-after-login.html" >Callback after login</a>
328362
</li>
@@ -412,6 +446,18 @@
412446
<li class="link">
413447
<a href="../classes/OAuthInfoEvent.html" >OAuthInfoEvent</a>
414448
</li>
449+
<li class="link">
450+
<a href="../classes/OAuthModuleConfig.html" >OAuthModuleConfig</a>
451+
</li>
452+
<li class="link">
453+
<a href="../classes/OAuthNoopResourceServerErrorHandler.html" >OAuthNoopResourceServerErrorHandler</a>
454+
</li>
455+
<li class="link">
456+
<a href="../classes/OAuthResourceServerConfig.html" >OAuthResourceServerConfig</a>
457+
</li>
458+
<li class="link">
459+
<a href="../classes/OAuthResourceServerErrorHandler.html" >OAuthResourceServerErrorHandler</a>
460+
</li>
415461
<li class="link">
416462
<a href="../classes/OAuthStorage.html" >OAuthStorage</a>
417463
</li>
@@ -447,6 +493,22 @@
447493
</ul>
448494
</li>
449495

496+
<li class="chapter">
497+
<div class="simple menu-toggler" data-toggle="collapse"
498+
data-target="#interceptors-links"
499+
>
500+
<span class="fa fa-exchange"></span>
501+
<span>Interceptors</span>
502+
<span class="fa fa-angle-down"></span>
503+
</div>
504+
<ul class="links collapse "
505+
id="interceptors-links"
506+
>
507+
<li class="link">
508+
<a href="../interceptors/DefaultOAuthInterceptor.html" >DefaultOAuthInterceptor</a>
509+
</li>
510+
</ul>
511+
</li>
450512

451513
<li class="chapter">
452514
<div class="simple menu-toggler" data-toggle="collapse"

0 commit comments

Comments
 (0)