mongodb / stitch-js-sdk

MongoDB Stitch JavaScript SDK
Apache License 2.0
113 stars 67 forks source link

Authentication issue with Custom Authentication provider and URL-fields #300

Closed allardvanderouw closed 5 years ago

allardvanderouw commented 5 years ago

We are using Auth0 as our identity provider and the Custom Authentication provider in Stitch to use the Auth0 token to login.

Stitch has the option to add metadata fields with names as an URL: Schermafbeelding 2019-08-08 om 15 54 57

I am using an URL property because of Auth0 where a custom token property is always an URL because of namespacing. The fields name and email are standard Auth0 properties, so that is why those are not URL's. I can save this and everything seems ok.

But when using the app, the login method is failing after refreshing the app twice:

Schermafbeelding 2019-08-08 om 16 03 49

After removing the http://localhost:3010/roles field, refreshing does not have any issues.

Is there anything I can do to fix this?

allardvanderouw commented 5 years ago

The value of http://localhost:3000/roles was ["backoffice", "customer"], it seems this value could not be passed correctly. I have changed the value to { backoffice: true, customer: true }