File tree Expand file tree Collapse file tree 5 files changed +7
-10
lines changed Expand file tree Collapse file tree 5 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 44 "author" : {
55 "name" : " Manfred Steyer"
66 },
7- "version" : " 8 .0.4 " ,
7+ "version" : " 9 .0.0 " ,
88 "repository" : " manfredsteyer/angular-oauth2-oidc" ,
99 "peerDependencies" : {
1010 "@angular/common" : " >=6.0.0" ,
Original file line number Diff line number Diff line change @@ -223,6 +223,9 @@ export class OAuthService extends AuthConfig implements OnDestroy {
223223 * @param options LoginOptions to pass through to `tryLogin(...)`
224224 */
225225 public loadDiscoveryDocumentAndLogin ( options : LoginOptions & { state ?: string } = null ) : Promise < boolean > {
226+ if ( ! options ) {
227+ options = { state : '' } ;
228+ }
226229 return this . loadDiscoveryDocumentAndTryLogin ( options ) . then ( _ => {
227230 if ( ! this . hasValidIdToken ( ) || ! this . hasValidAccessToken ( ) ) {
228231 this . initLoginFlow ( options . state ) ;
Original file line number Diff line number Diff line change 11import { Component } from '@angular/core' ;
22import { OAuthService } from 'angular-oauth2-oidc' ;
3- import { authCodeFlowConfig } from 'projects/sample/src/app/auth-code-flow.config' ;
43import { filter } from 'rxjs/operators' ;
5- import { JwksValidationHandler } from 'angular-oauth2-oidc ' ;
4+ import { authCodeFlowConfig } from './auth.config ' ;
65
76@Component ( {
87 selector : 'app-root' ,
@@ -16,8 +15,6 @@ export class AppComponent {
1615 this . oauthService . configure ( authCodeFlowConfig ) ;
1716 this . oauthService . loadDiscoveryDocumentAndLogin ( ) ;
1817
19- this . oauthService . tokenValidationHandler = new JwksValidationHandler ( ) ;
20-
2118 // Automatically load user profile
2219 this . oauthService
2320 . events
Original file line number Diff line number Diff line change 11import { AuthConfig } from 'angular-oauth2-oidc' ;
22
33export const authCodeFlowConfig : AuthConfig = {
4- issuer : 'https://demo.identityserver.io ' ,
4+ issuer : 'https://idsvr4.azurewebsites.net ' ,
55 redirectUri : window . location . origin + '/index.html' ,
66 clientId : 'spa' ,
77 responseType : 'code' ,
88 scope : 'openid profile email offline_access api' ,
99 showDebugInformation : true ,
10-
1110} ;
Original file line number Diff line number Diff line change 11import { AuthConfig } from 'angular-oauth2-oidc' ;
22
33export const authCodeFlowConfig : AuthConfig = {
4- // Url of the Identity Provider
5- // issuer: 'https://demo.identityserver.io',
6- issuer : 'http://localhost:5000' ,
4+ issuer : 'https://idsvr4.azurewebsites.net' ,
75
86 // URL of the SPA to redirect the user to after login
97 redirectUri : window . location . origin + '/index.html' ,
You can’t perform that action at this time.
0 commit comments