Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
manfredsteyer committed Dec 13, 2017
1 parent 5342f2a commit d3ba9d9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
35 changes: 27 additions & 8 deletions angular-oauth2-oidc/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -218,7 +227,7 @@ The following snippet contains the template for the login page:
</div>
```

### 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.

Expand All @@ -235,18 +244,28 @@ 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({
"Authorization": "Bearer " + this.oauthService.getAccessToken()
});
```

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
Expand Down
2 changes: 1 addition & 1 deletion angular-oauth2-oidc/src/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit d3ba9d9

Please sign in to comment.