Skip to content

Commit 8fb836d

Browse files
Merge branch 'master' into docs/fix-minor-comment-issues
2 parents bc6c4e1 + 0cac039 commit 8fb836d

File tree

6 files changed

+78
-51
lines changed

6 files changed

+78
-51
lines changed

README.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Successfully tested with **Angular 6** and its Router, PathLocationStrategy as w
3737
- The closed issues contain some ideas for PRs and enhancements (see labels)
3838

3939
# Features
40-
- Logging in via OAuth2 and OpenId Connect (OIDC) Implicit Flow (where user is redirected to Identity Provider)
41-
- "Logging in" via Password Flow (where user enters their password into the client)
40+
- Logging in via OAuth2 and OpenId Connect (OIDC) Implicit Flow (where a user is redirected to Identity Provider)
41+
- "Logging in" via Password Flow (where a user enters their password into the client)
4242
- Token Refresh for Password Flow by using a Refresh Token
4343
- Automatically refreshing a token when/some time before it expires
4444
- Querying Userinfo Endpoint
@@ -71,27 +71,27 @@ npm i angular-oauth2-oidc --save
7171
## Importing the NgModule
7272

7373
```TypeScript
74+
import { HttpClientModule } from '@angular/common/http';
7475
import { OAuthModule } from 'angular-oauth2-oidc';
75-
[...]
76+
// etc.
7677

7778
@NgModule({
7879
imports: [
79-
[...]
80-
HttpModule,
80+
// etc.
81+
HttpClientModule,
8182
OAuthModule.forRoot()
8283
],
8384
declarations: [
8485
AppComponent,
8586
HomeComponent,
86-
[...]
87+
// etc.
8788
],
8889
bootstrap: [
8990
AppComponent
9091
]
9192
})
9293
export class AppModule {
9394
}
94-
9595
```
9696

9797
## Configuring for Implicit Flow
@@ -100,7 +100,7 @@ This section shows how to implement login leveraging implicit flow. This is the
100100
Single Page Application. It sends the user to the Identity Provider's login page. After logging in, the SPA gets tokens.
101101
This also allows for single sign on as well as single sign off.
102102

103-
To configure the library the following sample uses the new configuration API introduced with Version 2.1.
103+
To configure the library, the following sample uses the new configuration API introduced with Version 2.1.
104104
Hence, the original API is still supported.
105105

106106
```TypeScript
@@ -229,7 +229,7 @@ var headers = new HttpHeaders({
229229
});
230230
```
231231

232-
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.
232+
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.
233233

234234
```TypeScript
235235
OAuthModule.forRoot({
@@ -250,10 +250,11 @@ See the [documentation](https://manfredsteyer.github.io/angular-oauth2-oidc/docs
250250

251251
## Tutorials
252252

253+
* [Tutorial with Demo Servers available online](https://www.softwarearchitekt.at/post/2016/07/03/authentication-in-angular-2-with-oauth2-oidc-and-guards-for-the-newest-new-router-english-version.aspx)
253254
* [Angular Authentication with OpenID Connect and Okta in 20 Minutes](https://developer.okta.com/blog/2017/04/17/angular-authentication-with-oidc)
254255
* [Add Authentication to Your Angular PWA](https://developer.okta.com/blog/2017/06/13/add-authentication-angular-pwa)
255256
* [Build an Ionic App with User Authentication](https://developer.okta.com/blog/2017/08/22/build-an-ionic-app-with-user-authentication)
256-
257+
* [On-Site Workshops](https://www.softwarearchitekt.at)
257258

258259

259260

docs-src/session-checks.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const authConfig: AuthConfig = {
3333
To get notified, you can hook up for the event ``session_terminated``:
3434

3535
```TypeScript
36-
this.oauthService.events.filter(e => e.type === 'session_terminated').subscribe(e => {
37-
console.debug('Your session has been terminated!');
36+
this.oauthService.events.pipe(filter(e => e.type === 'session_terminated')).subscribe(e => {
37+
console.debug('Your session has been terminated!');
3838
})
39-
```
39+
```

projects/lib/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": {
55
"name": "Manfred Steyer"
66
},
7-
"version": "4.0.2",
7+
"version": "4.0.3",
88
"repository": "manfredsteyer/angular-oauth2-oidc",
99
"dependencies": {
1010
"jsrsasign": "^8.0.12"

projects/lib/src/angular-oauth-oidic.module.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { OAuthStorage } from './types';
1+
import { OAuthStorage, OAuthLogger } from './types';
22
import { NgModule, ModuleWithProviders } from '@angular/core';
33
import { CommonModule } from '@angular/common';
44
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
@@ -15,6 +15,10 @@ import { DefaultOAuthInterceptor } from './interceptors/default-oauth.intercepto
1515
import { ValidationHandler } from './token-validation/validation-handler';
1616
import { NullValidationHandler } from './token-validation/null-validation-handler';
1717

18+
export function createDefaultLogger() {
19+
return console;
20+
}
21+
1822
export function createDefaultStorage() {
1923
return typeof sessionStorage !== 'undefined' ? sessionStorage : null;
2024
}
@@ -34,6 +38,7 @@ export class OAuthModule {
3438
providers: [
3539
OAuthService,
3640
UrlHelperService,
41+
{ provide: OAuthLogger, useFactory: createDefaultLogger },
3742
{ provide: OAuthStorage, useFactory: createDefaultStorage },
3843
{ provide: ValidationHandler, useClass: validationHandlerClass},
3944
{

0 commit comments

Comments
 (0)