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

OAuthHelper.SendTokenRequestAsync cannot retrieve error details from "invalid_grant" response #31

Closed
oatsoda opened this issue Dec 13, 2016 · 1 comment

Comments

@oatsoda
Copy link

oatsoda commented Dec 13, 2016

The following line:

https://github.com/OneDrive/onedrive-sdk-dotnet-msa-auth-adapter/blob/master/src/OneDrive.Sdk.Authentication.Common/OAuthHelper.cs#L285

Will throw an exception in the case of an "invalid_grant" due to the way that Microsoft.Graph fails to attempt to deserialize the response.

Therefore the OAuthErrorHandler.ThrowIfError call is never made to retrieve the error details.

As yet I am not sure whether this is a Microsoft.Graph error or something that the OneDrive.Sdk should handle.

The example response is:

HTTP/1.1 400 Bad Request
Cache-Control: no-store
Pragma: no-cache
Content-Length: 210
Content-Type: application/json
Server: Microsoft-IIS/8.5
X-WLID-Error: 0x8004100C
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000
X-XSS-Protection: 1; mode=block
Date: Tue, 13 Dec 2016 07:57:45 GMT
Connection: close

{"error":"invalid_grant","error_description":"The user could not be authenticated or the grant is expired. The user must first sign in and if needed grant the client application access to the requested scope."}
@oatsoda oatsoda changed the title OAuthHelper.SendTokenRequestAsync cannot retrieve error details from response OAuthHelper.SendTokenRequestAsync cannot retrieve error details from "invalid_grant" response Dec 13, 2016
@oatsoda
Copy link
Author

oatsoda commented Dec 16, 2016

See linked issue logged in Microsoft.Graph. They have confirmed this is a OneDrive API problem.

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

1 participant