Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIM portal Developer Try It page - not sending subscription key in header #2281

Closed
ilyasse05 opened this issue Aug 31, 2023 · 4 comments · Fixed by #2286
Closed

APIM portal Developer Try It page - not sending subscription key in header #2281

ilyasse05 opened this issue Aug 31, 2023 · 4 comments · Fixed by #2286

Comments

@ilyasse05
Copy link

ilyasse05 commented Aug 31, 2023

important !
**Wich kind of API **
GraphQL API

Bug description
The Ocp-Apim-Subscription-Key header value is not being set the first time using the 'Try It' feature. A workaround is to select a different subscription key from the dropdown.

Reproduction steps

  1. Go to the API Details page
  2. Select an operation
  3. Click on the 'Try it' button
  4. Notice that there is no Ocp-Apim-Subscription-Key listed in the Headers section.
  5. Fill out any required parameters and click 'Send'
  6. You will receive a 401 - Unauthorized response.
  7. Even if i add manualy Ocp-Apim-Subscription-Key it'is still not working

Expected behavior
The default subscription key that is filled in the dropdown should also be set as the default Ocp-Apim-Subscription-Key header.

Is your portal managed or self-hosted?
Managed

API Management service name
[e.g., contoso-api]

Environment
Operating system: Windows
Browser: Chrome
Additional context

@malincrist
Copy link
Member

Hello @ilyasse05 , thanks for reaching out!
I was not able to reproduce the issue you described. Can you please share your instance name and the API you re having issues with to apimportalfeedback@microsoft.com so we can investigate this further?

@malincrist malincrist added the Response needed Issues, which require a response from the author. label Sep 7, 2023
@ilyasse05
Copy link
Author

Hello @malincrist,
i found the root cause of the issue

My API GraphQL calls an AzureFunction, in url of azure function we have a param with a default value (personalized param for ower use) and the problem is that in developer portal the APIM add a second parameter that is forwarded to azurefunction with by adding "?subscription-key=XXXX" then the full url contains ? twice

image

the workaround is to add this policy in APIM, but if an user add another param it doesn't work

@ilyasse05
Copy link
Author

important !
i'am using a graphQL API with API REST HTTP it works correctly

@malincrist malincrist removed the Response needed Issues, which require a response from the author. label Sep 11, 2023
@malincrist
Copy link
Member

@ilyasse05 , got it now, thanks for the explanation! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants