This project has moved and is read-only. For the latest updates, please go here.

Error details not appearing in web exception

Sep 8, 2014 at 8:43 PM
In the GrantResourceOwnerCredentials, I add errors to the context; but those errors do not appear in the web exceptions.

Here is the code to add the error details to the context:
//Code to check credentials....
context.SetError("invalid_grant", "Invalid username or password", "");
//other code....
return Task.FromResult(0);
The server returns the following WebException response returns the following json string:


For now, I can pass the data in the header by adding the error message to the response header, but this seems like a hack. Any ideas?
Sep 8, 2014 at 8:59 PM
Yeah, so Google is not always your friend. It helps when you read the description of the methods you call to actually see what it's doing. So the context.Rejected() clears out the error information, and that's that.

Marked as answer by cjrogala on 9/8/2014 at 12:59 PM