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

[Identity] Rethrow AuthenticationErrors in DeviceCodeCredential poll loop #5430

Merged
merged 1 commit into from
Oct 7, 2019

Conversation

daviwil
Copy link
Contributor

@daviwil daviwil commented Oct 7, 2019

This change fixes an issue in DeviceCodeCredential where an unexpected AuthenticationError response would not break the polling loop, causing the loop to poll indefinitely. I ran across this issue because I was trying to authenticate with an AAD App Registration that was not configured as a "public client" so an invalid_client error was being returned. The error-checking switch statement was not looking for this specific error type nor did it have a default case, so the error was ignored.

The fix is to add a default case which rethrows any error type that we aren't explicitly checking for.

@daviwil daviwil requested review from ramya-rao-a and chradek October 7, 2019 19:17
@daviwil daviwil requested a review from sophiajt as a code owner October 7, 2019 19:17
Copy link
Contributor

@chradek chradek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for the quick fix!

Copy link
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@daviwil
Copy link
Contributor Author

daviwil commented Oct 7, 2019

Thanks all!

@daviwil daviwil merged commit 42470fd into Azure:master Oct 7, 2019
@daviwil daviwil deleted the fix-device-code-errors branch October 7, 2019 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants