Why is my authorizationParams coming through as [object Object]?

Hi,

Trying to integrate in a new React SPA and have issues signing in. Checking the call to ‘authorize’, and then double checking in the logs, I can see the below might be the issue?

“authorizationParams”: “[object Object]”

All it says in the logs is “Unable to issue redirect for OAuth 2.0 transaction”, which obviously doesn’t say much, but he redirect is in the authorizationParams, so it must be there. I have followed the guides and have initialized the Auth0 provider many ways now without success.

Any help is much appreciated.

Hi @matthew.ford ,

Can I suggest, when making the call, remove the authorizationParams{ } and just include the parameter.
For example, instead of:

authorizationParams: {
redirect_uri: ‘<MY_CALLBACK_URL>’
}

Just provide:

redirect_uri: ‘<MY_CALLBACK_URL>’

A bit late here, but I maintain the SDK in question.

This behavior typically comes when u use v1 of the SDK with the syntax for v2.
v2 has no concept of authorizationParams, so if you are using authorizationParams, ensure you use v2 of the SDK and it should be send along to Auth0 correctly.

Using v1 with authorizationParams is expected to send the object to Auth0 as you are seeing.

If you use v1, you want to use what’s mentioned by @nathan.jenkins above, but the syntax for v1 is redirectUri='<MY_CALLBACK_URL>' and not redirect_uri='<MY_CALLBACK_URL>'.

In v2, it’s redirect_uri as a property inside authorizationParams, while in v1 it was a redirectUri property on the root.

However, we recommend moving to v2 instead of sticking to v1.

So the solution here should be to ensure you are running v2, and not adapt the syntax to use v1.

1 Like