-
Notifications
You must be signed in to change notification settings - Fork 307
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
Test Console > OAuth 2.0 Authorization Code Authorization > "Unable to authenticate due to internal error." #2334
Comments
I got the same behavior even though the access_token was generated successfully and the requests work fine, but the alert keeps showing in a loop. I have tested with the latest versions of Chrome and Firefox.
|
I can confirm that disabling React Developer Tools in Firefox resolves the issue for me as well. |
Please log managed portal issues to Azure support team using Support + Help link in Azure portal and select Problem Type = Developer portal. |
Update: This does not look to be a Developer portal issue but rather injected extension code triggering an event listener created for the scenario of Authorization such as with Try It. The developer portal code for the authentication registers an event listener receiveMessage.
Setting a break point here, and then stepping through, the code triggering these event is coming from content.js from editor extension in this case. Other extensions can be debugged the same way. For the editor extension, what appears to be doing is a grammar check on the drop-down box for either the Authorization flow dropdown or the Subscription key drop down or all of them. It's triggering the dev portals receiveMessage eventlistener. I did find I could go into the settings and changed "This can read and change site data" to When you click the extension. This prevents the issue as well. Additionally, you could try experiment with turning off grammar or also exclude the developer portal domain from being used by the extension which is probably the best option and still have the extension available. |
Bug description
A customer reached out to us that they are receiving an error from the Test Console when they attempt to authorize (OAuth 2.0 Authorization Code Flow) the test console application. The error alert says "Unable to authenticate due to internal error."
Looking at the block of portal code that raises this alert, it would seem that the portal is receiving an unexpected message.
When trying to reproduce this ourselves, the only scenario where we regularly got this to happen is when we enabled a browser extension (for us, it was the Microsoft Editor extension--Microsoft Edge).
This was the message event that resulted in the error.
![Screenshot 2023-11-22 101816](https://private-user-images.githubusercontent.com/5169197/284973262-10e3a309-583c-41cb-a523-e219e0403485.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzMzE2MjMsIm5iZiI6MTcyMDMzMTMyMywicGF0aCI6Ii81MTY5MTk3LzI4NDk3MzI2Mi0xMGUzYTMwOS01ODNjLTQxY2ItYTUyMy1lMjE5ZTA0MDM0ODUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDdUMDU0ODQzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Zjg1NGIyOTQ5OGVhOGQ0YjhmZTA3YzdlYjUwOTZmODE4ZWZkMDFiY2I2ZDc5Y2NjNjVjYTE4YmQwMzNlOTAwMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.0ds43_Im4oF3T_lbVFuCrxF41ChcRBvXgJVrLKNuyrU)
When things are working correctly, this is the expected event shape:
![ProperMessage](https://private-user-images.githubusercontent.com/5169197/284973418-5ea649ed-4929-4245-b8a0-dd290aaed1bb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzMzE2MjMsIm5iZiI6MTcyMDMzMTMyMywicGF0aCI6Ii81MTY5MTk3LzI4NDk3MzQxOC01ZWE2NDllZC00OTI5LTQyNDUtYjhhMC1kZDI5MGFhZWQxYmIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDdUMDU0ODQzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjRlOGNlYzhjOGUwMWJhMWU5YzljYTMzYTliYThmZWM1NmE2NDA2MjJjZjdjYTQyMWRlOTQ0Njc1ODljY2I1YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.RZOcZz9GpSWImhnLQFf3_icjCEma5KuuGHKrATMflrE)
Reproduction steps
Expected behavior
The test console receives an access token without an error. FWIW, in our testing, the access token event is also received, so the Authorization header is populated. The error simply leads some users to believe it didn't work. Ideally, the portal event listener would ignore this unexpected event.
Is your portal managed or self-hosted?
Managed
Release tag or commit SHA (if using self-hosted version)
2.24.0
API Management service name
bbapiprod
Environment
The text was updated successfully, but these errors were encountered: