Given the impending deprecations we are updating our React 15 app from auth0-lock v10 to v11. In doing so we are experiencing the following error:
BlockquoteUncaught Error: accessToken parameter is not valid
at variable (index.js:35152)
at Object.check (index.js:35152)
at Authentication.userInfo (index.js:35152)
at index.js:35152
at index.js:35152
at IdTokenVerifier.verify (index.js:35152)
at WebAuth.validateToken (index.js:35152)
at WebAuth.validateAuthenticationResponse (index.js:35152)
at WebAuth.parseHash (index.js:35152)
at Auth0APIClient.parseHash (index.js:35152)
at Auth0WebAPI.parseHash (index.js:35152)
at parseHash (index.js:35152)
at index.js:35152
at List.__iterate (index.js:35152)
at List.forEach (index.js:35152)
at resumeAuth (index.js:35152)
Using the lock webpack example appears to operate correctly, we are using the same parameters, ClientID and domain in both applications. Neither the ‘authenticated’ or ‘authorization error’ events are fired when this error occurs. Any help is gratefully appreciated.
Hi Luis, yes we are. In the meantime we have managed to massage popup mode into a state where it works but for us we get one of three behaviours:
a blank popup window opens, closes, then we are logged in
a new blank chrome tab opens, closes, then we are logged in
a new blank chrome window opens, closes then we are logged in
Its very frustrating from a user experience perspective as it was not the behaviour of the previous version. The lock component also seems unable to remember the last login.
We have also noticed the lock component is leaking nonce data into local browser storage. It hasn’t caused a problem yet but will sooner or later.
can you please share what version you’re using? Ideally, you should upgrade to the latest version and try again. Also, what are your lock configurations etc.
Hi Luis, I have just been re-testing with v11.6.1 and still having the same issue. We also noticed impersonation is no longer working, this is a huge problem for us as we have some automated processes which depend on impersonation to login. Our lock is configured as follows:
No, when we attempt with the impersonation URL we get re-routed back to the login screen always. No errors in the logs or any indication of what went wrong. We are using a hash url in our web interface which I believe may be the cause of some redirection problems but I don’t know how to work around that.
Hi Luis, unfortunately I don’t have a code snippet much different to what I have already posted. There are a couple of further lines configuring the event listeners but that’s pretty much it. Prior to the update our configuration was set as:
Hi, I tried to reproduce this locally but I couldn’t. As you said, the same configuration works elsewhere. Do you think you can reproduce this in an isolated example so I can help you debug it?
Hi Luis, as mentioned in the initial post I cannot reproduce this issue in the auth0-react samples unfortunately. I am however able to produce the impersonation issue using the embedded login sample application. I will speak with our engineers and see if we can re-create the issue in an application we can distribute.
Hi Luis, thanks for the help so far. I have undone the workaround in our application and have maybe made some progress. Our lock configuration is as follows:
In this configuration the authResult.accessToken returned is undefined, this prevents us accessing the user profile however the access_token is present in the browser URL. I have attempted to set an audience however we get the error:
Uncaught Error: It is not possible to use the `auth.audience` option when the `oidcConformant` flag is set to false
It is true that this flag is set to false however we do not see the error in auth0-react-samples.
You can’t get this error if you’re using v11. This error is only thrown in v10:
v11 version:
My feeling is that you’re somehow messing up the url handling and you’re getting access_token undefined because of this issue. If you can create this issue on codesandbox.io, that would be the best way to help you out on this. You can find a ready-to-go example with react-router here: React Router - CodeSandbox
can you please type npm ls auth0-lock and cat node_modules/auth0-lock/package.json | grep version and paste the responses here, please? The codepath you’re running doesn’t exist in 11.x, so there’s something wrong somewhere.
Ok, I think we reached a workable situation. There were several contributing factors:
Establishing which settings were required for accessToken AND idTokens to be returned
Updating getProfile to getUserInfo utilising the accessToken
Establishing that the URL containing the accessToken had changed and required custom parsing using the resumeAuth method
Making sure NPM actually updated dependencies and wasn’t using locally cached dependencies. This may be a result of subsequent build steps which can create caches