I have an Azure AD Application which is registered for accessing few Power BI rest APIs. I have an issue with RedirectURI, As per the Microsoft definition we must have a redirect URL mentioned in App registration which is fine and valid from one point of view however that isn't going well for my scenario;
We have a product which is a Microsoft SharePoint app and that product needs access to customers tenancy. So for example, there is one customer who is using our product and our product needs access token.
The issue here I am facing is the redirect URL in my case, I am using as "https://contoso.com" however customer tenancy is https://mytenancy.sharepoint.com but after authentication, the token is being sent to https://contoso.com#id_token= however what I want is, it should send token to https://mytenancy.sharepoint.com#id_token
I cant pass dynamic return URL as per my knowledge. Is that correct assumption?
If that's correct, how can I overcome this situation? I am using ADAL.min.js so one other option is I open the auth process in the new browser window and as soon as redirect happens, I catch that and fetch a token from there?
Any other better way?