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

Vkontakte Provider - KeyNotFoundException: The given key was not present in the dictionary. #769

Closed
serega9i opened this issue Mar 30, 2023 · 2 comments
Labels
Milestone

Comments

@serega9i
Copy link

Describe the bug

In case of unsuccessful authorization, the VK response does not contain the "response" property, therefore it throws a KeyNotFoundException

using var enumerator = container.RootElement.GetProperty("response").EnumerateArray();

Expected behaviour

In case of unsuccessful authorization, VK response an "error" property instead of a "response". If there is an "error" property in the root, throw the custom exception

Actual behaviour

In case of unsuccessful authorization, the VK response does not contain the "response" property, therefore it throws a KeyNotFoundException

@serega9i serega9i added the bug label Mar 30, 2023
@martincostello
Copy link
Member

Thanks for the report.

If you could provide a full sample response for when there's an error, or even better submit a pull request with a proposed fix for it, then this is likely to get fixed sooner.

@serega9i
Copy link
Author

Thanks for the report.

If you could provide a full sample response for when there's an error, or even better submit a pull request with a proposed fix for it, then this is likely to get fixed sooner.

PR

@martincostello martincostello added this to the 8.2.0 milestone Sep 14, 2024
martincostello added a commit to martincostello/AspNet.Security.OAuth.Providers that referenced this issue Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants