diff --git a/README.MD b/README.MD index 29744423..d4f6c34b 100644 --- a/README.MD +++ b/README.MD @@ -31,7 +31,7 @@ Successfully tested with Angular 4.3+, Angular 5 and its Router,PathLocationStra ## New Features in Version 3.1 - +See [Release Notes](https://github.com/manfredsteyer/angular-oauth2-oidc/releases/tag/3.1) ## New Features in Version 3.0 diff --git a/angular-oauth2-oidc/README.MD b/angular-oauth2-oidc/README.MD index 6d7068e0..d4f6c34b 100644 --- a/angular-oauth2-oidc/README.MD +++ b/angular-oauth2-oidc/README.MD @@ -6,10 +6,10 @@ Support for OAuth 2 and OpenId Connect (OIDC) in Angular. ## Credits -- [generator-angular2-library](https://github.com/jvandemo/generator-angular2-library) for scaffolding a angular library +- [generator-angular2-library](https://github.com/jvandemo/generator-angular2-library) for scaffolding an Angular library - [jsrasign](https://kjur.github.io/jsrsasign/) for validating token signature and for hashing -- [Identity Server](https://github.com/identityserver) (used for Testing with an .NET/.NET Core Backend) -- [Keycloak (Redhad)](http://www.keycloak.org/) for Testing with Java +- [Identity Server](https://github.com/identityserver) (used for testing with an .NET/.NET Core Backend) +- [Keycloak (Redhat)](http://www.keycloak.org/) for testing with Java ## Resources @@ -19,10 +19,19 @@ https://github.com/manfredsteyer/angular-oauth2-oidc - Source Code Documentation https://manfredsteyer.github.io/angular-oauth2-oidc/angular-oauth2-oidc/docs/ +## Tutorials + +* [Angular Authentication with OpenID Connect and Okta in 20 Minutes](https://developer.okta.com/blog/2017/04/17/angular-authentication-with-oidc) +* [Add Authentication to Your Angular PWA](https://developer.okta.com/blog/2017/06/13/add-authentication-angular-pwa) +* [Build an Ionic App with User Authentication](https://developer.okta.com/blog/2017/08/22/build-an-ionic-app-with-user-authentication) + ## Tested Environment 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). +## New Features in Version 3.1 + +See [Release Notes](https://github.com/manfredsteyer/angular-oauth2-oidc/releases/tag/3.1) ## New Features in Version 3.0 @@ -41,7 +50,7 @@ See [Release Notes](https://github.com/manfredsteyer/angular-oauth2-oidc/release - Token Refresh for Implicit Flow by implementing "silent refresh" - Validating the signature of the received id_token - Providing Events via the observable ``events``. -- 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``). +- 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``). ## Additional Features - Logging in via OAuth2 and OpenId Connect (OIDC) Implicit Flow (where user is redirected to Identity Provider) @@ -188,7 +197,7 @@ export class HomeComponent { } public get name() { - let claims = this.oAuthService.getIdentityClaims(); + let claims = this.oauthService.getIdentityClaims(); if (!claims) return null; return claims.given_name; } @@ -218,7 +227,7 @@ The following snippet contains the template for the login page: ``` -### Skipping the login form +### Skipping the Login Form 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. @@ -235,7 +244,7 @@ var headers = new Headers({ }); ``` -If you are using the new HttpClient, use the class HttpHeaders instead: +If you are using the new ``HttpClient``, use the class ``HttpHeaders`` instead: ```TypeScript var headers = new HttpHeaders({ @@ -243,10 +252,20 @@ var headers = new HttpHeaders({ }); ``` +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. -## Some infos about Routing +```TypeScript +OAuthModule.forRoot({ + resourceServer: { + allowedUrls: ['http://www.angular.at/api'], + sendAccessToken: true + } +}) +``` +## Routing +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/). ## More Documentation diff --git a/angular-oauth2-oidc/src/package.json b/angular-oauth2-oidc/src/package.json index 0d5607b8..605f099f 100644 --- a/angular-oauth2-oidc/src/package.json +++ b/angular-oauth2-oidc/src/package.json @@ -1,6 +1,6 @@ { "name": "angular-oauth2-oidc", - "version": "3.1.2", + "version": "3.1.3", "repository": { "type": "git", "url": "https://github.com/manfredsteyer/angular-oauth2-oidc"