How to access Azure AD B2C user data through Azure Functions
Hello everyone
I have a SPA Angular app with AD B2C auth, in sign up flow i need to verify if the user to register company already exists on my app.
It occurs to me to do it this way: checking if the requesting user email domain if are on one of the users of my AD B2C registered users.
Example, a new user registers with:
user1@org1.com
The register will continue, and then logon, because org1.com doesn't exists in any user.
But after this, a new user:
user2@org1.com
Tries to register, AD B2C would reject the register and say: "An admin of your company org1.com needs to approve the register or you need to be invited." or something fail text.
To do this, i'm trying to create a custom policy on my AD B2C tenant on signup to connect to my Function App REST API with Azure Functions, but the authentication in my FunctionApp is configured to authenticate with Microsoft, so all the functions need auth, i need to create a new Function App with anonymous access?? i think that's a bad practice.
Any idea? thanks!