Azure Active Directory Invitation Policy - azure-active-directory

How to create invitation policy on Azure Active Directory and use it to send invitation to user for Business to Business (B2B) and Business to Consumer (B2C) in a web application? I use invitation API for Azure AD B2B to send invitation, but can't send when used in Azure AD B2C.

At this time, Azure AD's B2B collaboration feature and Azure AD B2C are not compatible. Azure AD B2C does not have any built-in invitation mechanism as it is tailored for self-service registration via the signup and signup/signin policies. There is an existing feedback request you can vote for: AADB2C: Send email invitation for new user to sign up.
You can implement this yourself by creating your own invitation UI. This UI would call the Azure AD graph to create the users.
You can then either:
Use the password reset policy as their first time experience since that sends an email to the user with a code. Note that you have very limited control over the look & contents of this email.
OR, create your own "redeeming" or "activation" mechanism, for example:
Ensure you set accountEnabled to false when creating the user.
Create an activation code/link and email that to the user (using SendGrid for example). You'll need to be able to associate that code/link to the user somewhere/somehow.
Once the user navigates to the link or uses the code, update the user via the Graph again to set its accountEnabled flag to true.
Note: this will only work for local users and not for social users.

Related

Create Office 365 user in Azure B2C using invitation api in microsoft graph

I need to register office 365 users residing in another Azure AD to be created programmatically using microsoft graph API into Azure AD B2C directory. I am successful in creating and logging into local accounts but creating external identity users hasn't been successful. The microsoft documentation is verbose too for this context. The scenario is as under.
Invited the user using invitation API.
User accepts the invitation received in their email and gets redirected to grant permission screen for the app, and then lands on the redirect url.
The user can be seen in Azure B2C users as invited and then external azure ad after invitation acceptance
Problem:
The same user can't login using the Signin flow that works for the local accounts. I noticed the signInIssuerId is also null for this user. The error received states please sign up user first/no account found.
I understand there is some disconnection behind where the invitation is sent but the user is not signed up from the graph api. How can this be achieved? I would hate to know if that would be possible only using IDEF / custom policies
Please help!
The problem is that these are social/federated users, not local ones.
You need to use the "SocialAndLocalAccounts" policies in the starter pack.
Invitations via the API are for B2B users. This type of user is not supported in B2C.
For examples of B2C invitations, look here.

How to allow external users to sign in to an app that is secure by Microsoft identity using Azure AD

I have an app (ASP.Net Classic) that is using Azure AD authentication. Now, we want to allow user outside of the organization to sign in. I read few document B2C and B2B, but I am unable to see which one to good for me.
I am looking that members in the organization should sign in and doesn't have to create new account. One of the option B2B suggested that to add user to in AD as a guest user but this is the manual process, it would be good if it can be automated. Also that doesn't describe how user would send the request to for login info.
It depends on your use case.
Imagine a large company. They have Azure AD for their employees. Now they want some suppliers to have access to their billing system. Those suppliers are guest users. That's B2B.
For guest users, an admin can send an invitation email that contains a redemption link.
B2C is for the customers of the company. They use the company's e-commerce system. They do not need access to the billing system.
B2C is self-service i.e. these users self-register and can change their profile or reset their password.

Azure AD B2B Invite API: disable verification

Our application is mainly used by internal users, who authenticate through AAD. Some pages need to be accessible to third-parties. Right now we are using custom tokens, but would like to switch to Azure AD B2B Invite API.
We just did some manual test runs and it seems to work exactly as expected, except for one thing: when inviting my standalone email address, I was asked to create a Microsoft account, which is fine. However, to do so, I had to first verify my email address (code sent to email) and then my phone (code sent via sms).
Is there any way to disable ideally both or at least the phone verification?
The only resource I found so far states that it's possible in B2C, which is not what we want.
The standalone email addresses has to undergo the invitation redemption process. In order to be able to invite people without redemption in Azure AD B2B you need an account with directory read permission of the partners tenant. Then you can add that user to your tenant with "Guest Inviter" role. Then that user can add the users to your tenant without invitation redemption process. Refer: Azure AD B2B: How to bulk add guest users without invitation redemption.

Is there way to setup approval for azure ad b2c user creation?

We want to use Azure AD B2C to use clien/contractors to create and use their account but all accounts has to be validated due to some regulations requirements.
So once user create account we want to make sure it is valid account before user can access application with newly created account
In your policy configuration, you can select the "User is new" claim type in the Application claims section. The first time user access to your application, the claim will appear in the id_token and you can handle it to do custom process with the user. This is the only reference i found about this claim: https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-reference-policies

Azure AD B2C send invitation email to new user

Using the new Azure AD B2C service in preview, I am looking to be able to send a user an invitation email to complete sign-up for our SaaS application. Each of our customers will manage their own users and I want them to be able generate an invitation email to their new users for access to our SaaS application. That user would then finish the sign-up process.
Part of this process will also to be able to include what "customer" this user is assigned to. Part of the invitation process I would like to be able to identify that this customer should be a part of this customer's database in our SaaS application.
This is not a supported feature. I recommend that you use our User Voice forum to make feature requests; we are tracking those.
There is an existing feature request for this: AADB2C: Send email invitation for new user to sign up
You can use custom policies to achieve this. You can send a JWT to B2C that includes the 'customer' the user is assigned to.
There is sample code here that sends the JWT to B2C.
The leaf policy that receives the JWT is here.
The sample app is here.

Resources