Add B2C Tenant app presence into main AD organization tenant

Paul Stevenson 6 Reputation points
2022-08-02T16:56:42.163+00:00

In my org, we have our main tenant and a B2C tenant. There are apps that live in the main tenant (mostly for internal use) and some for external customers that live in the B2C tenant. In the past, I was able to register apps from the main tenant into the B2C tenant (then a new enterprise application would appear) using the admin consent flow. What I did was

https://login.microsoftonline.com/<B2C_TENANT_ID>/v2.0/adminconsent?client_id=<MAIN_ORG_APP_ID>&<MAIN_ORG_APP_SCOPE>

However, when trying to do the opposite, add a presence for a B2C app registration in the main tenant, I get prompted the admin consent confirmation, I accept it, but no enterprise application gets added to my main tenant.

Example of what I am using to trying achieve it

https://login.microsoftonline.com/<MAIN_TENANT_ID>/v2.0/adminconsent?client_id=<B2C_APP_CLIENT_ID>&<B2C_APP_SCOPE>

Example prompt consent. (Everything looks correct)
227371-image.png

My B2C app is multi-tenant, but its presence won't get added to the main catalog of apps in the organization tenant.

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,652 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,567 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Paul Stevenson 6 Reputation points
    2022-08-11T13:22:15.153+00:00

    So, just by

    az ad sp create --id <B2C_APP_CLIENT_ID> somehow it finds the info for the app in the B2C tenant and adds its presence in the main tenant. The rest I did manually.

    1 person found this answer helpful.
    0 comments No comments

  2. AmanpreetSingh-MSFT 56,311 Reputation points
    2022-08-04T09:39:57.297+00:00

    @Paul Stevenson • Thank you for reaching out.

    I don't see any issues and ideally it should work. I tested this with my B2C and AAD tenants and it worked for me.

    Can you give it a try using the V1 endpoint, as mentioned below:
    https://login.microsoftonline.com/<MAIN_TENANT_ID>/adminconsent?client_id=<B2C_APP_CLIENT_ID>

    Check the Azure AD > Audit logs to see if there was an attempt to create a servicePrincipal and if the attempt was success or not, as shown below:
    228075-image.png

    Also, double-check the filters under the Enterprise Apps blade of the main tenant to ensure it is not hidden due to filter conditions.

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


  3. Paul Stevenson 6 Reputation points
    2022-08-09T14:42:20.913+00:00

    Appreciate your response @AmanpreetSingh-MSFT . Under my API app registration (in the b2c), I see no "Authorized Client Applications" in "Expose an API".

    The documentation for knownClientApplications says

    "Used for bundling consent if you have a solution that contains two parts: a client app and a custom web API app. If you enter the appID of the client app into this value, the user will only have to consent once to the client app. Azure AD will know that consenting to the client means implicitly consenting to the web API. It will automatically provision service principals for both the client and web API at the same time. Both the client and the web API app must be registered in the same tenant."

    https://learn.microsoft.com/en-us/azure/active-directory/develop/reference-app-manifest#knownclientapplications-attribute

    If I try to add the application Id of my client in the manifest directly, it gives an error (probably because the application Id doesn't exist in the B2C tenant):

    229587-screen-shot-2022-08-09-at-102759-am.png

    and finally, if I try to /adminconsent my client app in the B2C tenant (I'd have to use adminconsent v1 because v2 requires a scope, which my frontend client doesn't have). It yields:

    229548-screen-shot-2022-08-09-at-103017-am.png