Expose error details in client exception

13 views
Skip to first unread message

Nathan Baulch

unread,
Aug 7, 2014, 3:20:47 PM8/7/14
to dotnet...@googlegroups.com
I recently added the ability for users to revoke authorizations on my authorization server, which means token refresh requests will potentially fail more often in client applications.

It would be nice if the ProtocolException thrown from WebServerClient.RefreshAuthorization exposed the error details in the response content. I see this information is captured and serialized by TokenEndpointProtocolException.GetResponse in my token endpoint but nothing is done with it on the client side aside from logging it. Perhaps it could be de-serialized into something similar to an AccessTokenFailedResponse object and returned in the ProtocolException.FaultedMessage property? That way the client can see if the Error property matches "invalid_grant" rather than making assumptions about the cause of the error. Or even better, an enum representing the possible error values in section 5.2 of the spec could be used instead of magic protocol strings.
Reply all
Reply to author
Forward
0 new messages