Description
Checklist
- The issue can be reproduced in the auth0_flutter sample app (or N/A).
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Description
When I login with:
_auth0 = Auth0Web(domain, clientId);
_auth0.loginWithRedirect(
redirectUrl: 'http://localhost:8080/callback",
);
_auth0.onLoad().then((final credentials) { ... }
This works as expected. But, if I reload the page, the onLoad()
attempts to do a "silent authentication" to recover my credentials and this fails. The onLoad()
results in a network request being sent that looks like:
https://xxxx.auth0.com/authorize?...&redirect_uri=https%3A%2F%2Flocalhost%3A8080&...
And this fails, with the logs reporting "Failed Silent Auth: Callback URL mismatch. https://localhost:8080 is not in the list of allowed callback URLs."
This is correct: that URL is not in my list of allowed callback URLs, and nor do I want it to be. But, onLoad()
doesn't seem to accept a redirectUrl as a parameter.
You can work around this with:
_auth0.onLoad(parameters: {'redirect_uri': _redirectUrl}).then((final credentials) {...})
But, yuck. It would be much nicer if the Auth0Web
constructor accepted an optional redirectUri parameter like the js version does.
Reproduction
n/a
Additional context
No response
auth0_flutter version
1.5.0
Flutter version
3.20.0-7.0.pre.17
Platform
Web
Platform version(s)
No response