Closed ADNewsom09 closed 1 year ago
Additional context We cannot change the redirect URI on the application because there is another application type that uses the bare localhost, and other connecting applications expect the http://localhost:1234/MyApp redirect URI.
What "other application type" uses the bare localhost?
Note that there are different types (known as "platforms") of applications. Typically, one app (identified by its unique client_id) can target multiple platforms, such as a "Web" platform using redirect URI http://localhost:1234/path
for development and https://example.com/path
for production, together with a "Mobile and desktop application" platform using bare http://localhost
. They will all work together. You shouldn't need to specify a different redirect URI for acquire_token_interactive()
.
The exact situation you are talking about, but in reverse.
For this application, there is an SPA platform target that uses bare http://localhost:1234
and a "Mobile and desktop application" platform target that uses http://localhost:1234/path
. These are in production item with non-python libraries which support changing the redirect URI to include those paths, which is why changing the SPA paths away from bare localhost would be an issue for existing users. We are trying to build a python based client for this application.
there is an SPA platform target that uses bare
http://localhost:1234
... in production
Out of curiosity, why is an in-production SPA app would use localhost as redirect URI? Shouldn't localhost be only for development purpose, and shouldn't the production redirect URI contain https://YourCoolWebsite.com/...
?
There is of course interesting historical reasoning for this for us. I'm advocating for feature parity with the ms auth library for c#, which does support these paths.
By any chance the website hosting your SPA app is publicly accessible so that I can take a quick look?
Describe the bug Unable to specify a redirectURI in the form
http://localhost:1234/MyApp
when creating aPublicClientApplication
or using that withacquire_token_interactive
To Reproduce Steps to reproduce the behavior:
Expected behavior Using other packages like the C# one, we have been able to access this API.
What you see instead
AADSTS50011: The redirect URI 'http://localhost:49686' specified in the request does not match the redirect URIs configured for the application
The MSAL Python version you are using 1.22.0
Additional context We cannot change the redirect URI on the application because there is another application type that uses the bare localhost, and other connecting applications expect the http://localhost:1234/MyApp redirect URI. I see the docs say