Hello,
Summary: x/oauth2 uses the exact value of the Provider's token_type response field in the Authorization header during subsequent requests. The problem is that some OAuth2 providers return a lowercase token type (ex: "bearer") because the OAuth2 spec allows a case insensitive value (
https://tools.ietf.org/html/rfc6749#section-5.1). But, the same OAuth2 providers require a case sensitive token type (ex: "Bearer") in the Authorization header, mandated by the OAuth2 spec as case sensitive unless otherwise noted (
https://tools.ietf.org/html/rfc6750#section-2.1).
With the approval of this group, I would like to submit code and tests that remedy the issue.
if strings.ToLower(t.TokenType) == "bearer" {
return "Bearer"
}
if strings.ToLower(t.TokenType) == "mac" {
return "MAC"
}
Thanks for your consideration,
Andrew