Skip to content

Specifying a custom redirect URI in the PublicClientApplication #574

Closed as not planned
@ADNewsom09

Description

@ADNewsom09

Describe the bug
Unable to specify a redirectURI in the form http://localhost:1234/MyApp when creating a PublicClientApplication or using that with acquire_token_interactive

To Reproduce
Steps to reproduce the behavior:

authUrl = 'https://login.microsoftonline.com/' + app_config.TENANT_ID
app = msal.PublicClientApplication(app_config.APP_ID, authority=authUrl)
token = app.acquire_token_interactive(scopes=app_config.SCOPES)

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

The port to be used to listen to an incoming auth response. By default we will use a system-allocated port. (The rest of the redirect_uri is hard coded as http://localhost.)
But that isn't the case with other packages.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions