I've created a multi-tenant application in Azure AD B2C. Now lets say if this application is made in tenant A and I want to allow this application to access users of tenant B, I have to provide admin consent for this.
Url will be of form https://login.microsoftonline.com/{tenant-id}/adminconsent?client_id={client-id}. I can sign in with a user that has the required permissions and give consent for this and its done.
What I've understood from docs is that the above process creates a service principal in the specified tenant with required permissions.
Is there a way to achieve this programmatically or are there any Api's available for this?