Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"authorizedCallback incorrect state" error using the latest, unmodified code #10

Closed
hhubik opened this issue Mar 12, 2018 · 7 comments
Closed

Comments

@hhubik
Copy link

hhubik commented Mar 12, 2018

Downloaded the code. Did not make any changes. Built with no problems on Windows 8.1 x64.
After I get authenticated, I get re-directed back to the home page with the Sing In/Sign Up button enabled. I might be doing something wrong, being new to this ID management stuff, but was hoping the sample app would run out of the box. I see the following in the Chrome console:

APP_INITIALIZER STARTING
app.module.ts:84 APP STARTING
angular-auth-oidc-client.es5.js:939 onUserDataChanged: last = undefined, new = 
angular-auth-oidc-client.es5.js:939 STS server: https://login.microsoftonline.com/tfp/fabrikamb2c.onmicrosoft.com/b2c_1_susi/oauth2/v2.0/
angular-auth-oidc-client.es5.js:939 <iframe id=​"myiFrameForSilentRenew" style=​"display:​ none;​">​…​</iframe>​
core.js:3687 Angular is running in the development mode. Call enableProdMode() to enable the production mode.
angular-auth-oidc-client.es5.js:939 BEGIN authorizedCallback, no auth data
angular-auth-oidc-client.es5.js:939 {state%3D15208697604080.8240719611163863%26access_token%3DeyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ilg1ZVhrNHh5b2pORnVtMWtsMll0djhkbE5QNC1jNTdkTzZRR1RWQndhTmsifQ.eyJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNzc1NTI3ZmYtOWEzNy00MzA3LThiM2QtY2MzMTFmNThkOTI1L3YyLjAvIiwiZXhwIjoxNTIwODgwODg0LCJuYmYiOjE1MjA4NzcyODQsImF1ZCI6IjI1ZWVmNmU0LWM5MDUtNGEwNy04ZWI0LTBkMDhkNWRmOGIzZiIsImlkcCI6ImxpdmUuY29tIiwibmFtZSI6IkggSHViaWsiLCJvaWQiOiIwNmUxM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N1YiI6IjA2ZTExYmQzLTJmZGQtNDI1Ny04MDE3LWYyMjE0OTRjOGUwOSIsImF1ZCI6ImU3NjBjYWIyLWI5YTEtNGMwZC04NmZiLWZmNzA4NGFiZDkwMiIsImFjciI6ImIyY18xX3N1c2kiLCJub25jZSI6Ik4wLjE5ODQ1MDk4NjM2NjQzOTIxNTIwODc3Mjg2MzEyIiwiaWF0IjoxNTIwODc3Mjg0LCJhdXRoX3RpbWUiOjE1MjA4NzcyODQsImlkcCI6ImxpdmUuY29tIiwibmFtZSI6IkggSHViaWsiLCJvaWQiOiIwNmUxMWJkMy0yZmRkLTQyNTctODAxNy1mMjIxNDk0YzhlMDkiLCJlbWFpbHMiOlsiaGh1YmlrQHBvYm94LmNvbSJdLCJhdF9oYXNoIjoiNGRqTHZNVzdsSVBNakJkR0l5QVhtQSJ9.YAl6dJ0-gTSx0Yhv1CP-dMbKkdJxutmgz_H8QrSP0LCWKz8Ek7RDdfysrcDYSLDHrqZXIOLaljvI2MufA_AuHcXsFotDoQyHw7IZz_khv3iZIlidyjVY4O2m5KbaYhP4OEouc12QnXfrw7A6dGAH-wfx07wtSZnzdxOAqI8vx9XHB0wyOxZ3fvOpwHlNwIXTm-PQ3h25Dmtk0imrWV1q38820UA7R6GP3A_wGQRFrIoTjB16FNJmjC-jUdjT1-SXT_MQlAVW4xC2L9Z3T_F297_-UdEEhrQcEUXJC3qllifSUcWhFT2EpqgPg1cNX5UfZxSh_CQiaC3ujM92O7HnHw: undefined__proto__: Object
angular-auth-oidc-client.es5.js:939 authorizedCallback created, begin token validation
angular-auth-oidc-client.es5.js:939 jwks_uri: https://login.microsoftonline.com/fabrikamb2c.onmicrosoft.com/discovery/v2.0/keys?p=b2c_1_susi
angular-auth-oidc-client.es5.js:939 ValidateStateFromHashCallback failed, state: undefined local_state:15208697604080.8240719611163863
angular-auth-oidc-client.es5.js:930 authorizedCallback incorrect state
LoggerService.logWarning @ angular-auth-oidc-client.es5.js:930
StateValidationService.validateState @ angular-auth-oidc-client.es5.js:1288
OidcSecurityService.getValidatedStateResult @ angular-auth-oidc-client.es5.js:2125
(anonymous) @ angular-auth-oidc-client.es5.js:1927
SafeSubscriber.__tryOrUnsub @ Subscriber.js:240
SafeSubscriber.next @ Subscriber.js:187
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
MapSubscriber._next @ map.js:85
Subscriber.next @ Subscriber.js:92
FilterSubscriber._next @ filter.js:90
Subscriber.next @ Subscriber.js:92
MergeMapSubscriber.notifyNext @ mergeMap.js:151
InnerSubscriber._next @ InnerSubscriber.js:25
Subscriber.next @ Subscriber.js:92
onLoad @ http.js:2270
ZoneDelegate.invokeTask @ zone.js:421
onInvokeTask @ core.js:4740
ZoneDelegate.invokeTask @ zone.js:420
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1517
globalZoneAwareCallback @ zone.js:1543
XMLHttpRequest.send (async)
scheduleTask @ zone.js:2935
ZoneDelegate.scheduleTask @ zone.js:407
onScheduleTask @ zone.js:297
ZoneDelegate.scheduleTask @ zone.js:401
Zone.scheduleTask @ zone.js:232
Zone.scheduleMacroTask @ zone.js:255
scheduleMacroTaskWithCurrentZone @ zone.js:1092
(anonymous) @ zone.js:2967
proto.(anonymous function) @ zone.js:1372
(anonymous) @ http.js:2366
Observable._trySubscribe @ Observable.js:172
Observable.subscribe @ Observable.js:160
subscribeToResult @ subscribeToResult.js:23
MergeMapSubscriber._innerSub @ mergeMap.js:138
MergeMapSubscriber._tryNext @ mergeMap.js:135
MergeMapSubscriber._next @ mergeMap.js:118
Subscriber.next @ Subscriber.js:92
ScalarObservable._subscribe @ ScalarObservable.js:51
Observable._trySubscribe @ Observable.js:172
Observable.subscribe @ Observable.js:160
MergeMapOperator.call @ mergeMap.js:92
Observable.subscribe @ Observable.js:157
FilterOperator.call @ filter.js:61
Observable.subscribe @ Observable.js:157
MapOperator.call @ map.js:57
Observable.subscribe @ Observable.js:157
CatchOperator.call @ catchError.js:80
Observable.subscribe @ Observable.js:157
OidcSecurityService.authorizedCallback @ angular-auth-oidc-client.es5.js:1926
RedirectComponent.ngOnInit @ redirect.component.ts:13
checkAndUpdateDirectiveInline @ core.js:12369
checkAndUpdateNodeInline @ core.js:13893
checkAndUpdateNode @ core.js:13836
debugCheckAndUpdateNode @ core.js:14729
debugCheckDirectivesFn @ core.js:14670
(anonymous) @ RedirectComponent_Host.ngfactory.js? [sm]:1
debugUpdateDirectives @ core.js:14655
checkAndUpdateView @ core.js:13802
callViewAction @ core.js:14153
execEmbeddedViewsAction @ core.js:14111
checkAndUpdateView @ core.js:13803
callViewAction @ core.js:14153
execComponentViewsAction @ core.js:14085
checkAndUpdateView @ core.js:13808
callWithDebugContext @ core.js:15056
debugCheckAndUpdateView @ core.js:14593
ViewRef_.detectChanges @ core.js:11577
(anonymous) @ core.js:5907
ApplicationRef.tick @ core.js:5907
(anonymous) @ core.js:5740
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4749
ZoneDelegate.invoke @ zone.js:387
Zone.run @ zone.js:138
NgZone.run @ core.js:4566
next @ core.js:5740
schedulerFn @ core.js:4331
SafeSubscriber.__tryOrUnsub @ Subscriber.js:240
SafeSubscriber.next @ Subscriber.js:187
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
Subject.next @ Subject.js:56
EventEmitter.emit @ core.js:4311
checkStable @ core.js:4714
onHasTask @ core.js:4762
ZoneDelegate.hasTask @ zone.js:441
ZoneDelegate._updateTaskCount @ zone.js:461
Zone._updateTaskCount @ zone.js:285
Zone.runTask @ zone.js:205
drainMicroTaskQueue @ zone.js:595
Promise.then (async)
scheduleMicroTask @ zone.js:578
ZoneDelegate.scheduleTask @ zone.js:410
onScheduleTask @ zone.js:297
ZoneDelegate.scheduleTask @ zone.js:401
Zone.scheduleTask @ zone.js:232
Zone.scheduleMicroTask @ zone.js:252
scheduleResolveOrReject @ zone.js:856
resolvePromise @ zone.js:803
(anonymous) @ zone.js:728
Promise.then (async)
(anonymous) @ zone.js:1014
ZoneAwarePromise @ zone.js:875
Ctor.then @ zone.js:1013
resolvePromise @ zone.js:779
(anonymous) @ zone.js:728
(anonymous) @ angular-auth-oidc-client.es5.js:51
ZoneAwarePromise @ zone.js:875
step @ angular-auth-oidc-client.es5.js:51
fulfilled @ angular-auth-oidc-client.es5.js:40
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4749
ZoneDelegate.invoke @ zone.js:387
Zone.run @ zone.js:138
(anonymous) @ zone.js:858
ZoneDelegate.invokeTask @ zone.js:421
onInvokeTask @ core.js:4740
ZoneDelegate.invokeTask @ zone.js:420
Zone.runTask @ zone.js:188
drainMicroTaskQueue @ zone.js:595
Promise.then (async)
scheduleMicroTask @ zone.js:578
ZoneDelegate.scheduleTask @ zone.js:410
onScheduleTask @ zone.js:297
ZoneDelegate.scheduleTask @ zone.js:401
Zone.scheduleTask @ zone.js:232
Zone.scheduleMicroTask @ zone.js:252
scheduleResolveOrReject @ zone.js:856
resolvePromise @ zone.js:803
(anonymous) @ zone.js:728
Promise.then (async)
(anonymous) @ zone.js:1014
ZoneAwarePromise @ zone.js:875
Ctor.then @ zone.js:1013
resolvePromise @ zone.js:779
(anonymous) @ zone.js:728
(anonymous) @ angular-auth-oidc-client.es5.js:51
ZoneAwarePromise @ zone.js:875
step @ angular-auth-oidc-client.es5.js:51
(anonymous) @ angular-auth-oidc-client.es5.js:52
ZoneAwarePromise @ zone.js:875
__awaiter @ angular-auth-oidc-client.es5.js:38
OidcConfigService.load_using_custom_stsServer @ angular-auth-oidc-client.es5.js:110
(anonymous) @ app.module.ts:21
ApplicationInitStatus.runInitializers @ core.js:3573
(anonymous) @ core.js:5500
_callAndReportToErrorHandler @ core.js:5679
(anonymous) @ core.js:5498
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4749
ZoneDelegate.invoke @ zone.js:387
Zone.run @ zone.js:138
NgZone.run @ core.js:4566
PlatformRef.bootstrapModuleFactory @ core.js:5489
(anonymous) @ core.js:5568
ZoneDelegate.invoke @ zone.js:388
Zone.run @ zone.js:138
(anonymous) @ zone.js:858
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
drainMicroTaskQueue @ zone.js:595
Promise.then (async)
scheduleMicroTask @ zone.js:578
ZoneDelegate.scheduleTask @ zone.js:410
Zone.scheduleTask @ zone.js:232
Zone.scheduleMicroTask @ zone.js:252
scheduleResolveOrReject @ zone.js:856
ZoneAwarePromise.then @ zone.js:946
PlatformRef.bootstrapModule @ core.js:5568
(anonymous) @ main.ts:11
./src/main.ts @ main.bundle.js:89
__webpack_require__ @ inline.bundle.js:55
0 @ main.bundle.js:97
__webpack_require__ @ inline.bundle.js:55
webpackJsonpCallback @ inline.bundle.js:26
(anonymous) @ main.bundle.js:1
angular-auth-oidc-client.es5.js:930 authorizedCallback, token(s) validation failed, resetting
LoggerService.logWarning @ angular-auth-oidc-client.es5.js:930
(anonymous) @ angular-auth-oidc-client.es5.js:1968
SafeSubscriber.__tryOrUnsub @ Subscriber.js:240
SafeSubscriber.next @ Subscriber.js:187
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
MapSubscriber._next @ map.js:85
Subscriber.next @ Subscriber.js:92
FilterSubscriber._next @ filter.js:90
Subscriber.next @ Subscriber.js:92
MergeMapSubscriber.notifyNext @ mergeMap.js:151
InnerSubscriber._next @ InnerSubscriber.js:25
Subscriber.next @ Subscriber.js:92
onLoad @ http.js:2270
ZoneDelegate.invokeTask @ zone.js:421
onInvokeTask @ core.js:4740
ZoneDelegate.invokeTask @ zone.js:420
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1517
globalZoneAwareCallback @ zone.js:1543
XMLHttpRequest.send (async)
scheduleTask @ zone.js:2935
ZoneDelegate.scheduleTask @ zone.js:407
onScheduleTask @ zone.js:297
ZoneDelegate.scheduleTask @ zone.js:401
Zone.scheduleTask @ zone.js:232
Zone.scheduleMacroTask @ zone.js:255
scheduleMacroTaskWithCurrentZone @ zone.js:1092
(anonymous) @ zone.js:2967
proto.(anonymous function) @ zone.js:1372
(anonymous) @ http.js:2366
Observable._trySubscribe @ Observable.js:172
Observable.subscribe @ Observable.js:160
subscribeToResult @ subscribeToResult.js:23
MergeMapSubscriber._innerSub @ mergeMap.js:138
MergeMapSubscriber._tryNext @ mergeMap.js:135
MergeMapSubscriber._next @ mergeMap.js:118
Subscriber.next @ Subscriber.js:92
ScalarObservable._subscribe @ ScalarObservable.js:51
Observable._trySubscribe @ Observable.js:172
Observable.subscribe @ Observable.js:160
MergeMapOperator.call @ mergeMap.js:92
Observable.subscribe @ Observable.js:157
FilterOperator.call @ filter.js:61
Observable.subscribe @ Observable.js:157
MapOperator.call @ map.js:57
Observable.subscribe @ Observable.js:157
CatchOperator.call @ catchError.js:80
Observable.subscribe @ Observable.js:157
OidcSecurityService.authorizedCallback @ angular-auth-oidc-client.es5.js:1926
RedirectComponent.ngOnInit @ redirect.component.ts:13
checkAndUpdateDirectiveInline @ core.js:12369
checkAndUpdateNodeInline @ core.js:13893
checkAndUpdateNode @ core.js:13836
debugCheckAndUpdateNode @ core.js:14729
debugCheckDirectivesFn @ core.js:14670
(anonymous) @ RedirectComponent_Host.ngfactory.js? [sm]:1
debugUpdateDirectives @ core.js:14655
checkAndUpdateView @ core.js:13802
callViewAction @ core.js:14153
execEmbeddedViewsAction @ core.js:14111
checkAndUpdateView @ core.js:13803
callViewAction @ core.js:14153
execComponentViewsAction @ core.js:14085
checkAndUpdateView @ core.js:13808
callWithDebugContext @ core.js:15056
debugCheckAndUpdateView @ core.js:14593
ViewRef_.detectChanges @ core.js:11577
(anonymous) @ core.js:5907
ApplicationRef.tick @ core.js:5907
(anonymous) @ core.js:5740
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4749
ZoneDelegate.invoke @ zone.js:387
Zone.run @ zone.js:138
NgZone.run @ core.js:4566
next @ core.js:5740
schedulerFn @ core.js:4331
SafeSubscriber.__tryOrUnsub @ Subscriber.js:240
SafeSubscriber.next @ Subscriber.js:187
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
Subject.next @ Subject.js:56
EventEmitter.emit @ core.js:4311
checkStable @ core.js:4714
onHasTask @ core.js:4762
ZoneDelegate.hasTask @ zone.js:441
ZoneDelegate._updateTaskCount @ zone.js:461
Zone._updateTaskCount @ zone.js:285
Zone.runTask @ zone.js:205
drainMicroTaskQueue @ zone.js:595
Promise.then (async)
scheduleMicroTask @ zone.js:578
ZoneDelegate.scheduleTask @ zone.js:410
onScheduleTask @ zone.js:297
ZoneDelegate.scheduleTask @ zone.js:401
Zone.scheduleTask @ zone.js:232
Zone.scheduleMicroTask @ zone.js:252
scheduleResolveOrReject @ zone.js:856
resolvePromise @ zone.js:803
(anonymous) @ zone.js:728
Promise.then (async)
(anonymous) @ zone.js:1014
ZoneAwarePromise @ zone.js:875
Ctor.then @ zone.js:1013
resolvePromise @ zone.js:779
(anonymous) @ zone.js:728
(anonymous) @ angular-auth-oidc-client.es5.js:51
ZoneAwarePromise @ zone.js:875
step @ angular-auth-oidc-client.es5.js:51
fulfilled @ angular-auth-oidc-client.es5.js:40
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4749
ZoneDelegate.invoke @ zone.js:387
Zone.run @ zone.js:138
(anonymous) @ zone.js:858
ZoneDelegate.invokeTask @ zone.js:421
onInvokeTask @ core.js:4740
ZoneDelegate.invokeTask @ zone.js:420
Zone.runTask @ zone.js:188
drainMicroTaskQueue @ zone.js:595
Promise.then (async)
scheduleMicroTask @ zone.js:578
ZoneDelegate.scheduleTask @ zone.js:410
onScheduleTask @ zone.js:297
ZoneDelegate.scheduleTask @ zone.js:401
Zone.scheduleTask @ zone.js:232
Zone.scheduleMicroTask @ zone.js:252
scheduleResolveOrReject @ zone.js:856
resolvePromise @ zone.js:803
(anonymous) @ zone.js:728
Promise.then (async)
(anonymous) @ zone.js:1014
ZoneAwarePromise @ zone.js:875
Ctor.then @ zone.js:1013
resolvePromise @ zone.js:779
(anonymous) @ zone.js:728
(anonymous) @ angular-auth-oidc-client.es5.js:51
ZoneAwarePromise @ zone.js:875
step @ angular-auth-oidc-client.es5.js:51
(anonymous) @ angular-auth-oidc-client.es5.js:52
ZoneAwarePromise @ zone.js:875
__awaiter @ angular-auth-oidc-client.es5.js:38
OidcConfigService.load_using_custom_stsServer @ angular-auth-oidc-client.es5.js:110
(anonymous) @ app.module.ts:21
ApplicationInitStatus.runInitializers @ core.js:3573
(anonymous) @ core.js:5500
_callAndReportToErrorHandler @ core.js:5679
(anonymous) @ core.js:5498
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4749
ZoneDelegate.invoke @ zone.js:387
Zone.run @ zone.js:138
NgZone.run @ core.js:4566
PlatformRef.bootstrapModuleFactory @ core.js:5489
(anonymous) @ core.js:5568
ZoneDelegate.invoke @ zone.js:388
Zone.run @ zone.js:138
(anonymous) @ zone.js:858
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
drainMicroTaskQueue @ zone.js:595
Promise.then (async)
scheduleMicroTask @ zone.js:578
ZoneDelegate.scheduleTask @ zone.js:410
Zone.scheduleTask @ zone.js:232
Zone.scheduleMicroTask @ zone.js:252
scheduleResolveOrReject @ zone.js:856
ZoneAwarePromise.then @ zone.js:946
PlatformRef.bootstrapModule @ core.js:5568
(anonymous) @ main.ts:11
./src/main.ts @ main.bundle.js:89
__webpack_require__ @ inline.bundle.js:55
0 @ main.bundle.js:97
__webpack_require__ @ inline.bundle.js:55
webpackJsonpCallback @ inline.bundle.js:26
(anonymous) @ main.bundle.js:1
angular-auth-oidc-client.es5.js:930 #state%3D15208697604080.8240719611163863%26access_token%3DeyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ilg1ZVhrNHh5b2pORnVtMW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5.js:930
(anonymous) @ angular-auth-oidc-client.es5.js:1969
SafeSubscriber.__tryOrUnsub @ Subscriber.js:240
SafeSubscriber.next @ Subscriber.js:187
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
MapSubscriber._next @ map.js:85
Subscriber.next @ Subscriber.js:92
FilterSubscriber._next @ filter.js:90
Subscriber.next @ Subscriber.js:92
MergeMapSubscriber.notifyNext @ mergeMap.js:151
InnerSubscriber._next @ InnerSubscriber.js:25
Subscriber.next @ Subscriber.js:92
onLoad @ http.js:2270
ZoneDelegate.invokeTask @ zone.js:421
onInvokeTask @ core.js:4740
ZoneDelegate.invokeTask @ zone.js:420
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1517
globalZoneAwareCallback @ zone.js:1543
XMLHttpRequest.send (async)
scheduleTask @ zone.js:2935
ZoneDelegate.scheduleTask @ zone.js:407
onScheduleTask @ zone.js:297
ZoneDelegate.scheduleTask @ zone.js:401
Zone.scheduleTask @ zone.js:232
Zone.scheduleMacroTask @ zone.js:255
scheduleMacroTaskWithCurrentZone @ zone.js:1092
(anonymous) @ zone.js:2967
proto.(anonymous function) @ zone.js:1372
(anonymous) @ http.js:2366
Observable._trySubscribe @ Observable.js:172
Observable.subscribe @ Observable.js:160
subscribeToResult @ subscribeToResult.js:23
MergeMapSubscriber._innerSub @ mergeMap.js:138
MergeMapSubscriber._tryNext @ mergeMap.js:135
MergeMapSubscriber._next @ mergeMap.js:118
Subscriber.next @ Subscriber.js:92
ScalarObservable._subscribe @ ScalarObservable.js:51
Observable._trySubscribe @ Observable.js:172
Observable.subscribe @ Observable.js:160
MergeMapOperator.call @ mergeMap.js:92
Observable.subscribe @ Observable.js:157
FilterOperator.call @ filter.js:61
Observable.subscribe @ Observable.js:157
MapOperator.call @ map.js:57
Observable.subscribe @ Observable.js:157
CatchOperator.call @ catchError.js:80
Observable.subscribe @ Observable.js:157
OidcSecurityService.authorizedCallback @ angular-auth-oidc-client.es5.js:1926
RedirectComponent.ngOnInit @ redirect.component.ts:13
checkAndUpdateDirectiveInline @ core.js:12369
checkAndUpdateNodeInline @ core.js:13893
checkAndUpdateNode @ core.js:13836
debugCheckAndUpdateNode @ core.js:14729
debugCheckDirectivesFn @ core.js:14670
(anonymous) @ RedirectComponent_Host.ngfactory.js? [sm]:1
debugUpdateDirectives @ core.js:14655
checkAndUpdateView @ core.js:13802
callViewAction @ core.js:14153
execEmbeddedViewsAction @ core.js:14111
checkAndUpdateView @ core.js:13803
callViewAction @ core.js:14153
execComponentViewsAction @ core.js:14085
checkAndUpdateView @ core.js:13808
callWithDebugContext @ core.js:15056
debugCheckAndUpdateView @ core.js:14593
ViewRef_.detectChanges @ core.js:11577
(anonymous) @ core.js:5907
ApplicationRef.tick @ core.js:5907
(anonymous) @ core.js:5740
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4749
ZoneDelegate.invoke @ zone.js:387
Zone.run @ zone.js:138
NgZone.run @ core.js:4566
next @ core.js:5740
schedulerFn @ core.js:4331
SafeSubscriber.__tryOrUnsub @ Subscriber.js:240
SafeSubscriber.next @ Subscriber.js:187
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
Subject.next @ Subject.js:56
EventEmitter.emit @ core.js:4311
checkStable @ core.js:4714
onHasTask @ core.js:4762
ZoneDelegate.hasTask @ zone.js:441
ZoneDelegate._updateTaskCount @ zone.js:461
Zone._updateTaskCount @ zone.js:285
Zone.runTask @ zone.js:205
drainMicroTaskQueue @ zone.js:595
Promise.then (async)
scheduleMicroTask @ zone.js:578
ZoneDelegate.scheduleTask @ zone.js:410
onScheduleTask @ zone.js:297
ZoneDelegate.scheduleTask @ zone.js:401
Zone.scheduleTask @ zone.js:232
Zone.scheduleMicroTask @ zone.js:252
scheduleResolveOrReject @ zone.js:856
resolvePromise @ zone.js:803
(anonymous) @ zone.js:728
Promise.then (async)
(anonymous) @ zone.js:1014
ZoneAwarePromise @ zone.js:875
Ctor.then @ zone.js:1013
resolvePromise @ zone.js:779
(anonymous) @ zone.js:728
(anonymous) @ angular-auth-oidc-client.es5.js:51
ZoneAwarePromise @ zone.js:875
step @ angular-auth-oidc-client.es5.js:51
fulfilled @ angular-auth-oidc-client.es5.js:40
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4749
ZoneDelegate.invoke @ zone.js:387
Zone.run @ zone.js:138
(anonymous) @ zone.js:858
ZoneDelegate.invokeTask @ zone.js:421
onInvokeTask @ core.js:4740
ZoneDelegate.invokeTask @ zone.js:420
Zone.runTask @ zone.js:188
drainMicroTaskQueue @ zone.js:595
Promise.then (async)
scheduleMicroTask @ zone.js:578
ZoneDelegate.scheduleTask @ zone.js:410
onScheduleTask @ zone.js:297
ZoneDelegate.scheduleTask @ zone.js:401
Zone.scheduleTask @ zone.js:232
Zone.scheduleMicroTask @ zone.js:252
scheduleResolveOrReject @ zone.js:856
resolvePromise @ zone.js:803
(anonymous) @ zone.js:728
Promise.then (async)
(anonymous) @ zone.js:1014
ZoneAwarePromise @ zone.js:875
Ctor.then @ zone.js:1013
resolvePromise @ zone.js:779
(anonymous) @ zone.js:728
(anonymous) @ angular-auth-oidc-client.es5.js:51
ZoneAwarePromise @ zone.js:875
step @ angular-auth-oidc-client.es5.js:51
(anonymous) @ angular-auth-oidc-client.es5.js:52
ZoneAwarePromise @ zone.js:875
__awaiter @ angular-auth-oidc-client.es5.js:38
OidcConfigService.load_using_custom_stsServer @ angular-auth-oidc-client.es5.js:110
(anonymous) @ app.module.ts:21
ApplicationInitStatus.runInitializers @ core.js:3573
(anonymous) @ core.js:5500
_callAndReportToErrorHandler @ core.js:5679
(anonymous) @ core.js:5498
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4749
ZoneDelegate.invoke @ zone.js:387
Zone.run @ zone.js:138
NgZone.run @ core.js:4566
PlatformRef.bootstrapModuleFactory @ core.js:5489
(anonymous) @ core.js:5568
ZoneDelegate.invoke @ zone.js:388
Zone.run @ zone.js:138
(anonymous) @ zone.js:858
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
drainMicroTaskQueue @ zone.js:595
Promise.then (async)
scheduleMicroTask @ zone.js:578
ZoneDelegate.scheduleTask @ zone.js:410
Zone.scheduleTask @ zone.js:232
Zone.scheduleMicroTask @ zone.js:252
scheduleResolveOrReject @ zone.js:856
ZoneAwarePromise.then @ zone.js:946
PlatformRef.bootstrapModule @ core.js:5568
(anonymous) @ main.ts:11
./src/main.ts @ main.bundle.js:89
__webpack_require__ @ inline.bundle.js:55
0 @ main.bundle.js:97
__webpack_require__ @ inline.bundle.js:55
webpackJsonpCallback @ inline.bundle.js:26
(anonymous) @ main.bundle.js:1
@HWouters
Copy link
Owner

The example was running out of the box. I didn't run it for a while, will give it a try and see if something is broken.

@alvipeo
Copy link

alvipeo commented Mar 12, 2018

I think these are related - damienbod/angular-auth-oidc-client#195

@HWouters
Copy link
Owner

For me this project still works out of the box: npm install, npm start and everything works as expected. However, I'm able to reproduce the exact same error if I update angular from current 5.2.0 to 5.2.8. I don't know what the issue is and from which version it starts failing.

@hhubik
Copy link
Author

hhubik commented Mar 12, 2018

Did a bit more debugging. There seems to be a problem in the angular-auth-oidc-client.es5.js code. Specifically in the section below. When I step through the code, the hash variable value in the code below is URL-encoded, meaning it does not contain & and =. I wonder if hash needs to be unescaped before the parsing step. Also is it possible that the problem occurs on my machine because I recently updated node to the latest version (8.10.0)?

    OidcSecurityService.prototype.authorizedCallback = function (hash) {
        var _this = this;
        var /** @type {?} */ silentRenew = this.oidcSecurityCommon.silentRenewRunning;
        var /** @type {?} */ isRenewProcess = silentRenew === 'running';
        this.loggerService.logDebug('BEGIN authorizedCallback, no auth data');
        this.resetAuthorizationData(isRenewProcess);
        hash = hash || window.location.hash.substr(1);
        var /** @type {?} */ result = hash
            .split('&')
            .reduce(function (resultData, item) {
            var /** @type {?} */ parts = item.split('=');
            resultData[parts[0]] = parts[1];
            return resultData;
        }, {});

@damienbod
Copy link
Contributor

damienbod commented Mar 12, 2018

@hhubik @HWouters

Looks like this is a breaking change in the angular 5.2.8 version, and it wasn't even mentioned in the release notes...

Here's a fix for now:

if (window.location.hash) {
window.location.hash = decodeURIComponent(window.location.hash);
// authorizedCallback returns wrong result when hash is URI encoded
this.oidcSecurityService.authorizedCallback();
} else {
this.oidcSecurityService.authorize();
}

@hhubik
Copy link
Author

hhubik commented Mar 13, 2018

@damienbod thank you! But where exactly should I put this fix?

@hhubik
Copy link
Author

hhubik commented Mar 13, 2018

OK. The problem goes away if I put the @damienbod fix in the ngOnInit() method in my RedirectComponent as follows:

  ngOnInit() {
    // this.oidcSecurityService.authorizedCallback();
    if (window.location.hash) {
      window.location.hash = decodeURIComponent(window.location.hash);
      // authorizedCallback returns wrong result when hash is URI encoded
      this.oidcSecurityService.authorizedCallback();
    } else {
      this.oidcSecurityService.authorize();
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants