Azure / api-management-developer-portal

Developer portal provided by the Azure API Management service.
MIT License
487 stars 317 forks source link

OpenID Connect - autorization_code #2135

Closed Hallgeir closed 6 months ago

Hallgeir commented 1 year ago

Bug description

When trying to authenticate using openid connect with autorization code in developer portal i get this error message. (It works using implicit flow) image

Configuration of OpenID Connect in Developer portal. image As you can see from the metadata endpoint, I'm using a b2c tenant, but not sure if that is relevant.

Reproduction steps

  1. Set up B2C Tenant
  2. Register an App Registration with correct redirect uri's image
  3. Setup OpenID Connect with API Management in Azure
  4. Try an api in Developer Portal using Autorization Code Flow

Expected behavior

You should receive and access token

Is your portal managed or self-hosted?

Managed

API Management service name

NorsvinAPIManagement

Environment

ghost commented 1 year ago

@Hallgeir, thank you for opening this issue. We will triage it within the next few business days.

harunrst commented 1 year ago

Hi @Hallgeir , I am seeing this in the logs:

The redirect URI 'https://oauth.pstmn.io/v1/callback' provided in the request is not registered for the client id '2d6a7464-e3ef-4a1a-b20f-f53e7e7eb4e4'

If you update the redirect uri for authorization code flow, it should work. And sorry for the unclear error message, we will improve it.

Hallgeir commented 1 year ago

The log message you refer to is me testing with postman, and was an attempt before I added the correct redirect uri for postman. The error is still present using the Developer Portal. I provisioned a new api management to see if that could fix the problem, but I get the same error in the developer portal of the new apim:

mrcarlosdev commented 6 months ago

This issue is related to managed developer portal. We advise you to create a Azure support request to get assistance on this issue. Please refer to the below link to create a new Azure support request, Please select Problem Type = "Developer Portal" in the request to route it appropriately.

https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request