-
-
Notifications
You must be signed in to change notification settings - Fork 52
feat: Add data:application/json;base64 support to AuthenticationOauth2 #263
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
feat: Add data:application/json;base64 support to AuthenticationOauth2 #263
Conversation
raise <| NotSupportedException($"Content type '{contentType}' is not supported.") | ||
|
||
let deserializeCreds (privateKey: Uri) = | ||
backgroundTask { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would write it as
match privateKey.Scheme with
| "file" ->
openAndDeserializeCreds privateKey.LocalPath
| "data" ->
decodeAndDeserializeCreds privateKey |> Task.FromResult
| _ ->
raise <| NotSupportedException $"Scheme '{privateKey.Scheme}' is not supported."
and would also skip .ToLowerInvariant()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having a lot of trouble with this one. The mixing of sync and async is resulting in casting issues.
9dbf712
to
937ba5b
Compare
937ba5b
to
97388ad
Compare
@Lanayx I've been able to drop these changes into my application and verify that the base64 credentials decode is working. |
Hi I'm hoping to use this feature in a .NET Framework project using the 2.x branch, but it looks like it hasn't been merged into that branch. I was able to apply the changes to that branch, although I had to change one line: |
Yes, it is ok, you are welcome to send a PR |
Added support for using OAuth2 with a base64 encoded string instead of a file path.
Workaround for #253