We are using GCP Identity Platform for Auth. The FE project is using @angular/fire@7.5.1 and Angular v14.
So the login works fine using SigninWithPopup.
Thing is, our IP users have tenants associated with them and I would like to signing using the tenant information as well. The tenant information comes from a support database, which identifies what is the tenant ID on IP for that user.
So, I went there and added the tenant information before calling the signInWithPopup
:
async signInWithGoogle(tenant: DataModel.Tenant) {
const auth = getAuth();
auth.tenantId = tenant.tenantId; <-- this is the difference
const provider = new GoogleAuthProvider();
return signInWithPopup(auth, provider);
}
When I add that tenantId and start the login process, instead of a pop-up asking which of my Google Accounts I want to use, I get one saying: Access blocked: This app's request is invalid. Error 400: redirect_uri_mismatch
If I comment the tenant line, it works fine again.
While the pop-up is open, there is a error details
that I can click which opens that says:
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy.
If you're the app developer, register the redirect URI in the Google Cloud Console.
Thing is, the URL in there is already defined on the Client API Credentials for the OAuth we are using, and the fact that it works when the tenant is not informed, makes me wonder if that is really where the problem lies.
Anyone knows what else should I be looking to make that work?