question

RavindraPawar-6374 avatar image
0 Votes"
RavindraPawar-6374 asked MarileeTurscak-MSFT commented

Azure AD B2C Tenant

Hello Team,

We have an Azure AD B2C tenant.

I am adding users to the Azure AD B2C using MS Graph API (POST https://graph.microsoft.com/v1.0/users) from our custom application.

I have below questions in this particular scenario.
1. While creating an user the password profile is mandatory(an initial password is required). Is it possible to create an user with Auto-generated password using MS Graph API? The Azure portal provides this functionality.
2. After the user is created I need to send an welcome email to the user. I tried sending the email using MS Graph API (POST https://graph.microsoft.com/v1.0/me/sendMail) but getting error as below:

{"error":{"code":"OrganizationFromTenantGuidNotFound","message":"The tenant for tenant guid '5XXXXd93-0XXc-4XXc-a4XX-ebXXXb92XX8X' does not exist.","innerError":{"oAuthEventOperationId":"bXXX2de3-XXX5-4XX9-XX7c-eXXX41eXXXX7","oAuthEventcV":"1XXXqoXXXXCxkI/yFXXXXw.1.1","errorUrl":"https://aka.ms/autherrors#error-InvalidTenant","requestId":"cXXXXe5X-XXX7-4XXX-aXX0-8XXXX9c8XXX5","date":"2021-06-07T05:08:27"}}}

How to send an e-mail using the MS Graph API with Azure AD B2C Tenant? Do we need to have Exchange online license under O365 subscription? If yes, how to configure it with Azure AD B2C Tenant if we already have the O365 subscription in other Azure AD tenant.


Best Regards,
Ravindra

azure-ad-b2cmicrosoft-graph-explorer
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Changing a user password can only be done in the current user's context via Microsoft Graph. This is the call for that:

POST https://graph.microsoft.com/beta/me/changePassword

Body { "currentPassword": "Passw0rd33333", "newPassword": "Passw0rd44444" }

You can use this call for a system-generated password when the caller does not submit a password.

POST https://graph.microsoft.com/beta/users/{id | userPrincipalName}/authentication/passwordMethods/{id}/resetPassword


For your other question, I would check these threads:

https://stackoverflow.com/questions/55229894/the-tenant-for-tenant-guid-does-not-exist-even-though-user-is-listed-on-users

https://stackoverflow.com/questions/58345786/how-to-access-email-of-an-user-on-b2c-using-graph-api

0 Votes 0 ·

0 Answers