问题
I'm trying to setup Angular (v11) app with FirebaseUI auth via different providers, following steps provided here.
The only one that works for me is Google. Others I'm trying all give various errors:
- Twitter: "Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings"
- GitHub: "Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared"
- Microsoft: "The provided value for the input parameter 'redirect_uri' is not valid"
However, I followed the steps & configured API keys & callback URL in the respective platforms per Firebase instructions (using the callback Firebase shows when you enable each sign-in method). The only one not so sure I did properly is Microsoft, but the others were pretty straight forward.
This is the published page in case you want to see the behavior.
This is the code repo -- the main files where I implemented the logic are in auth.service.ts & login.component.ts (I hid the apiKey/appId in firebaseConfig, since not sure if it's sensitive).
Anyone had luck with it & perhaps has some tip? Thanks!!
回答1:
I finally got it to work. It appears the callback URL it suggests you use in Firebase is wrong. See this example from one of the platforms: .
To make it work I had to remove the "-default-rtdb" (so correct callback in this case is: "https://bit-of-gaia.firebaseapp.com/__/auth/handler")
来源:https://stackoverflow.com/questions/65261848/angular-firebaseui-auth-via-twitter-github-microsoft-not-working