Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.
This repository was archived by the owner on May 17, 2024. It is now read-only.

How to maintain multiple ClientID's in Multitenant scenario with Vendor, Customers and a Microsft Tenant #294

@rickblommetjes

Description

@rickblommetjes

Issue

Please provide us with the following information:

This issue is for the sample

    - [ ] 1-1) Sign-in with Azure AD
    - [ ] 1-2) Sign-in with Azure AD B2C
    - [ ] 2-1) Acquire a Token and call Microsoft Graph
    - [ ] 3-1) Protect and call a web API on Azure AD
    - [ ] 3-2) Protect and call a web API on Azure AD B2C
    - [ ]   4) Deploy to Azure Storage and App Service
    - [ ] 5-1) Call a web API using App Roles
    - [ ] 5-2) Call a web API using Security Groups
    - [ ] 6-1) Call Microsoft Graph using on-behalf-of flow
    - [X ] 6-2) Call a multi-tenant web API

This issue is for a

    - [ ] bug report -> please search issues before submitting
    - [x ] question
    - [ ] feature request
    - [ ] documentation issue or request

Minimal steps to reproduce

We have an Multi-tenant angular 14 SPA app connecting to our own vendor tenant, our customers will use this scenario to login on our SPA app with their own Microsoft Indentity. Sofar so good, the SPA app also needs to connect to the D365 Business Central API wich is a Microsoft tenant where each customer has an app-registration to access their D365 Business Central API. How to enable this scenario providing the correct client-id for each customer when connecting to the protected route tps://api.businesscentral.dynamics.com/v2.0/{{tenantId}}, it needs to use an different ClientId for each customer tenantId, to acquire the proper token.

Any log messages given by the failure

ERROR ServerError: invalid_client: AADSTS650057: Invalid resource. The client has requested access to a resource which is not listed in the requested permissions in the client's application registration. Client app ID: {clientId}} (ES2 Portal Login). Resource value from request: https://api.businesscentral.dynamics.com. Resource app ID: xxxxxxxx. List of valid resources from app registration: 00000003-0000-0000-c000-000000000000.

Expected/desired behavior

Library version

"@azure/msal-angular": "^2.5.2",

Browser and version

Chrome, Edge, Firefox, Safari?

Mention any other details that might be useful

Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions