Skip to content

Cannot read property 'nonceStateSeparator' of null in Version 4.0.0+ #383

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

Closed
dansd opened this issue Jul 24, 2018 · 8 comments
Closed

Cannot read property 'nonceStateSeparator' of null in Version 4.0.0+ #383

dansd opened this issue Jul 24, 2018 · 8 comments

Comments

@dansd
Copy link

dansd commented Jul 24, 2018

Trying to update the plugin from 3.1.4 to 4.0.0 in my project with Keycloak as Identity Server, I receive the following error after signing in successfully:

image
The property that is empty in this case is this.config.

This might be related to changes in #224, as the error occurs in the line that has been changed in the corresponding commit: fcd0f8b#diff-08337bf7d3a0f6acf2d15ef79129c66cR1121

@jeroenheijmans
Copy link
Collaborator

Just to check: have you also upgraded to Angular 6? (Required for v4+)

@dansd
Copy link
Author

dansd commented Jul 25, 2018

Yes, I use the package.json provided by ng new, plus bootstrap and angular-oauth2-oidc for version 4:

"dependencies": {
    "@angular/animations": "^6.0.3",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/core": "^6.0.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "angular-oauth2-oidc": "^4.0.2",
    "bootstrap": "^4.1.3",
    "core-js": "^2.5.4",
    "rxjs": "^6.0.0",
    "zone.js": "^0.8.26"
}

For version 3 replace 4.0.2 with 3.1.4, and rxjs-compat is necessary as well (it installed ^6.2.2) and it works again.

@HJoost
Copy link

HJoost commented Jul 30, 2018

Same here...

@jeroenheijmans
Copy link
Collaborator

Any chance you can make a minimal repro (e.g. something based of ng new) so others can have a look at the problem too?

Without a repro it's a bit guesswork at the root cause.

Another question (related to the repro): how are you configuring the service? Are you providing a constant value for the AuthConfig type via the Angular DI container? Or are you using the oauthService.configure(config) method? If you're using the latter, try switching to the first by adding something like { provide: AuthConfig, useValue: authConfig } where authConfig is a const, and let us know if that helps at all.

@bogeorgetw
Copy link

I just recently change code from having a my AuthConfig object statically created as a const to dynamically created as part of a method and I'm now seeing the "Unable to get property 'nonceStateSeparator' of undefined or null reference" error in IE Edge as well but not Chrome.

Below is a screen shot of the code. Essentially azure client and tenant id's are now passed in whereas previously they were hardcoded as part of an AuthConfig const that was passed to oauthService.configure

image

@jeroenheijmans
Copy link
Collaborator

@bogeorge Any chance you could help us out by creating a minimal repro, some small but complete example demonstrating the issue?

@bogeorgetw
Copy link

@jeroenheijmans My best chance would be to try to create it this weekend as I'm swamped on several projects. The challenge might be that my example would also be using Azure AD which requires an app to be registered to get the azureClientId and of course an Azure Subscription to get the azureTenantId.

@jeroenheijmans
Copy link
Collaborator

Going to close the issue for the moment, as we have no reproducible scenario yet to debug this with. Please notify us if there's a repro available and we could reopen the issue!

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