Skip to content
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

"Bearer" authorization token prefix is misspelled in IssuanceAccessToken #52

Closed
srosenda opened this issue Jul 10, 2024 · 1 comment · Fixed by #51
Closed

"Bearer" authorization token prefix is misspelled in IssuanceAccessToken #52

srosenda opened this issue Jul 10, 2024 · 1 comment · Fixed by #51

Comments

@srosenda
Copy link
Contributor

The prefix should be spelled exactly as "Bearer", not "BEARER" as in

public extension IssuanceAccessToken {
var authorizationHeader: [String: String] {
["Authorization": "BEARER \(accessToken)"]
}
func dPoPOrBearerAuthorizationHeader(
dpopConstructor: DPoPConstructorType?,
endpoint: URL?
) throws -> [String: String] {
if tokenType == TokenType.bearer {
return ["Authorization": "BEARER \(accessToken)"]
} else if let dpopConstructor, tokenType == TokenType.dpop, let endpoint {
return [
"Authorization": "DPoP \(accessToken)",
"DPoP": try dpopConstructor.jwt(endpoint: endpoint, accessToken: accessToken)
]
}
return ["Authorization": "BEARER \(accessToken)"]
}

See https://datatracker.ietf.org/doc/html/rfc6750#section-2.1. Fix available in PR #51.

@srosenda
Copy link
Contributor Author

srosenda commented Aug 7, 2024

Note that OAuth implementations should in fact accept the authentication scheme "Bearer" spelled with any mix of lower- and uppercase characters. See openid/OpenID4VCI#371 (comment) and discussion linked to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant