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

Device Code Flow logs too many errors while polling #631

Closed
7 tasks
bgavrilMS opened this issue Oct 8, 2018 · 3 comments
Closed
7 tasks

Device Code Flow logs too many errors while polling #631

bgavrilMS opened this issue Oct 8, 2018 · 3 comments
Assignees
Milestone

Comments

@bgavrilMS
Copy link
Member


name: Bug report
about: Create a report to help us improve


Which Version of MSAL are you using ?
Note that to get help, you need to run the latest preview or non-preview version
For ADAL, please log issues to https://github.com/AzureAD/azure-activedirectory-library-for-dotnet
2.2.0

Which platform has the issue?
all, I tested with .net core

What authentication flow has the issue?

  • Desktop
    • Interactive
    • WIA
    • U/P
    • [ x ] Device code flow (browserless)
  • Mobile
  • Web App
    • Authorization code
    • OBO
  • Web API
    • OBO

Other? - please describe;

Repro

  1. Create a simple app and that uses Device Code Flow (for example, the sample https://github.com/Azure-Samples/active-directory-dotnetcore-devicecodeflow-v2)
  2. Add logging to it
  3. Run the app and examine the logs

Actual: the logs are full of error messages capturing the "authorization_pending" exception
Expected: these should be logged as info messages, as we are just polling for the user to have entered the auth;

Error (True) MSAL 1.0.0.0 MSAL.NetCore Microsoft Windows 10.0.17134 [10/08/2018 12:37:44 - 7a951dc1-e58d-4fa1-a1ca-2d7bd4e291e7] Microsoft.Identity.Client.MsalServiceException: AADSTS70016: Pending end-user authorization.
Trace ID: 3416a13d-a656-452a-b017-80373c5b3000
Correlation ID: 7a951dc1-e58d-4fa1-a1ca-2d7bd4e291e7
Timestamp: 2018-10-08 12:37:44Z
ErrorCode: authorization_pending
StatusCode: 400
Claims:

@MarkZuber
Copy link
Contributor

This is due to OAuth2Client auto-throwing an exception whenever there's an error response (non 200) and logging the exception (OAuth2Client.cs line 167). We'll need to look into error responses there because there are cases (like this one) where we don't want to throw/log since the error conditions are expected.

@jmprieur jmprieur added this to the 2.3.0-preview milestone Oct 9, 2018
@jmprieur
Copy link
Contributor

Let's change the severity of this error, so that it only logs when the log serverity is info.

@jmprieur
Copy link
Contributor

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

No branches or pull requests

3 participants