Microsoft OAuth login works in test, fails in live

Hi, I’m using Bubble’s API Connector to implement login with Microsoft OAuth. In version-test, it works correctly: the Current User is created, and the user’s email is received as expected. However, in live, although the login completes and I can enter the user, the Current User appears blank, and I can’t access the email or link it to my Users table.

My goal is to allow only the users I already have in my Users table to log in; I don’t want new accounts to be created, just let existing users sign in. Does anyone know how to make the Current User populate correctly in live, the same way it works in version-test?

Usually, this happens because your Microsoft app isn’t set up with the live redirect link.

In Azure (Microsoft’s dashboard), you have to add two links: one for your test version and one for your live domain. If the live link is missing, the login will “work” but Bubble won’t know who the Current User is.

Also, just so you know, Bubble automatically creates new users when someone signs in with Microsoft. If you don’t want that, you can add a step after login to check if the email already exists in your Users table. If it doesn’t, log them out or show a message.

Thanks for your reply! I already had the live redirect link set up in Azure, and I had also implemented the step to check if the user’s email exists in my Users table and log them out if it doesn’t.

The issue I’m running into is that in the live version, the Current User is being created with an empty email field. Because of that, my workflow always treats them as not existing in the Users table and kicks them out.

In version-test it works perfectly: the email is received and I can match it. But in live, the email comes back blank. Do you know why the email might be empty only in live, and not in test?