-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
I am attempting to authenticate to an OAuth2 service. I am using this code:
[RestSharp.RestClient].Authenticator = new RestSharp.Authenticators.OAuth2.OAuth2AuthorizationRequestHeaderAuthenticator(token, "Bearer");
This way of Authentication attaches an Authorization header, however it is encoded, when it should not be, resulting in a header with the form of
Authorization: Bearer%20[token]
as it encodes the space in the header.
Manually attaching an Authorization header using
[RestSharp.RestRequest].AddHeader("Authorization", $"Bearer {token}", false)
works and resolves the issue, however the OAuth2 authentication procedure should work too.
Metadata
Metadata
Assignees
Labels
No labels