Firebase Google Login does not ask for user passwords and redirects to a wrong page.
The firebase email sign in does work.
I have set up the Authorised redirect URIs to the correct ones in the config JS code, in the firebase console and in the Google Cloud API key.
When I press the Google button it redirects to something like:
www.myurl.com/__/auth/handler?apiKey=xxxxxxxxxxxxxxxxxxxxx&appName=%5BDEFAULT%5D-firebaseui-temp&authType=signInViaRedirect&redirectUrl=https%3A%2F%2Fwww.myurl.com%2Fsign-in&v=9.13.0&providerId=google.com&scopes=profile
The code in my site is the following:
In the header:
<script src="https://www.gstatic.com/firebasejs/9.13.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.13.0/firebase-auth-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/ui/6.0.2/firebase-ui-auth.js"></script>
<link
type="text/css"
rel="stylesheet"
href="https://www.gstatic.com/firebasejs/ui/6.0.2/firebase-ui-auth.css"
/>
in the body, I have an element with the following code:
<div id="firebaseui-auth-container"></div>
<script type="text/javascript">
//const auth = firebase.auth();
// FirebaseUI config.
var uiConfig = {
// Important: the following URL should be in both Firebase and Gloogle Cloud authorised clients
signInSuccessUrl: "/private/main",
// autoUpgradeAnonymousUsers: true,
signInOptions: [
// Leave the lines as is for the providers you want to offer your users.
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.EmailAuthProvider.PROVIDER_ID,
],
// tosUrl and privacyPolicyUrl accept either url string or a callback.
// Terms of service url/callback.
tosUrl: "/terms-of-services",
// Privacy policy url/callback.
privacyPolicyUrl: "/privacy-policy"
};
// App's Firebase configuration
const firebaseConfig = {
apiKey: "xxxxxxxxxxxxxxxxxx",
authDomain: "myurl.com",
projectId: "xxxxxxxxxxxxxxxxx",
storageBucket: "xxxxxxxxxxxxxxxx",
messagingSenderId: "xxxxxxxxxxxxxxxxx",
appId: "xxxxxxxxxxxxxxxxx",
};
// Initialize Firebase
const app = firebase.initializeApp(firebaseConfig);
// Initialize the FirebaseUI Widget using Firebase.
var ui = new firebaseui.auth.AuthUI(firebase.auth());
// The start method will wait until the DOM is loaded.
ui.start("#firebaseui-auth-container", uiConfig);
</script>