api-management-developer-portal
api-management-developer-portal copied to clipboard
Incorrect message for invalid/missing subscription key using policy fragment with cors & Users shouldn't be able to send requests when not subscribed.
Every bug report should have precise description and reproduction steps; console traces or source code references are appreciated.
For assistance requests, contact Azure support or submit a post on Stack Overflow. We don't provide support through GitHub Issues. Feature requests can be raised on the Azure Feedback Forum.
Bug description
- Incorrect message is showing when the subscription key is incorrect or missing. Cors policy has been set using policy fragment and it works as expected with the correct subscription key. This isn't an issue when not using policy fragments. (setting Cors in API scope without policy fragment)
Issue:
Expected Response:
- Users shouldn't be able to send requests for APIs within products that require subscription keys, it is possible to do this currently. There should be some kind of message/error letting the user know that a subscription is required for the API like in old portal.
New Portal Ex:
Old Portal Ex:
Reproduction steps
First Bug:
- Create policy fragment that has cors policy.
- Add cors policy fragment to API scope.
- Go to api-details page for an API that you are subscribed to test with correct subscription key. (It should work).
- Test with incorrect subscription key (Cors error).
- Update Cors without policy fragement.
- Test again with incorrect subscription key (expected behavior 401 response).
Second Bug:
- Go to api-details page for an API whos product requires a subscription key and you are not subscribed to it.
- Click try it for pop up.
- Test API without inputting subscription key (It should allow you to send request).
Expected behavior
- Incorrect message is displaying related to cors when using a policy fragment that contains cors policy. It should work the same whether or not cors is in a policy fragment.
- For APIs whos product requires a subscription key, it shouldn't be possible to test it without inputting a subscription key.
Is your portal managed or self-hosted?
Self-hosted (Managed has same issue)
Release: 2.23.0
Environment
Google Chrome