Skip to content

Commit

Permalink
Merge pull request #19100 from sberyozkin/conflicting_auth_mechanisms
Browse files Browse the repository at this point in the history
Update HttpCredentialTransport to keep a lower case authentication scheme
  • Loading branch information
stuartwdouglas authored Jul 30, 2021
2 parents d8d04a1 + 7c63f4d commit d2a6c85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import io.quarkus.oidc.OIDCException;
import io.quarkus.oidc.OidcTenantConfig;
import io.quarkus.oidc.common.runtime.OidcConstants;
import io.quarkus.security.identity.IdentityProviderManager;
import io.quarkus.security.identity.SecurityIdentity;
import io.quarkus.security.identity.request.AuthenticationRequest;
Expand Down Expand Up @@ -79,6 +80,6 @@ public Set<Class<? extends AuthenticationRequest>> getCredentialTypes() {
public HttpCredentialTransport getCredentialTransport() {
//not 100% correct, but enough for now
//if OIDC is present we don't really want another bearer mechanism
return new HttpCredentialTransport(HttpCredentialTransport.Type.AUTHORIZATION, "bearer");
return new HttpCredentialTransport(HttpCredentialTransport.Type.AUTHORIZATION, OidcConstants.BEARER_SCHEME);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public HttpCredentialTransport(Type transportType, String typeTarget) {
public HttpCredentialTransport(Type transportType, String typeTarget, String authenticationScheme) {
this.transportType = Objects.requireNonNull(transportType);
this.typeTarget = Objects.requireNonNull(typeTarget).toLowerCase();
this.authenticationScheme = Objects.requireNonNull(authenticationScheme);
this.authenticationScheme = Objects.requireNonNull(authenticationScheme).toLowerCase();
}

public enum Type {
Expand Down

0 comments on commit d2a6c85

Please sign in to comment.