Angular FirebaseUI Auth via Twitter, GitHub, Microsoft Not Working

。_饼干妹妹 提交于 2021-01-29 17:20:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!