Class BasicAuthenticationMechanism
- java.lang.Object
-
- io.quarkus.vertx.http.runtime.security.BasicAuthenticationMechanism
-
- All Implemented Interfaces:
HttpAuthenticationMechanism
@Singleton public class BasicAuthenticationMechanism extends Object implements HttpAuthenticationMechanism
The authentication handler responsible for BASIC authentication as described by RFC2617
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism
HttpAuthenticationMechanism.ChallengeSender
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHARSETstatic StringSILENTstatic StringUSER_AGENT_CHARSETSA comma separated list of patterns and charsets.-
Fields inherited from interface io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism
DEFAULT_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description BasicAuthenticationMechanism(String realmName)BasicAuthenticationMechanism(String realmName, boolean silent)BasicAuthenticationMechanism(String realmName, boolean silent, Charset charset, Map<Pattern,Charset> userAgentCharsets)BasicAuthenticationMechanism(String realmName, String mechanismName)Deprecated.BasicAuthenticationMechanism(String realmName, String mechanismName, boolean silent)Deprecated.BasicAuthenticationMechanism(String realmName, String mechanismName, boolean silent, Charset charset, Map<Pattern,Charset> userAgentCharsets)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<io.quarkus.security.identity.SecurityIdentity>authenticate(io.vertx.ext.web.RoutingContext context, io.quarkus.security.identity.IdentityProviderManager identityProviderManager)io.smallrye.mutiny.Uni<ChallengeData>getChallenge(io.vertx.ext.web.RoutingContext context)HttpCredentialTransportgetCredentialTransport()The credential transport, used to make sure multiple incompatible mechanisms are not installed May be null if this mechanism cannot interfere with other mechanismsSet<Class<? extends io.quarkus.security.identity.request.AuthenticationRequest>>getCredentialTypes()Returns the required credential types.intgetPriority()Returns a priority which determines in which order HttpAuthenticationMechanisms handle the authentication and challenge requests when it is not possible to select the best candidate authentication mechanism based on the request credentials or path specific configuration.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism
sendChallenge
-
-
-
-
Field Detail
-
SILENT
public static final String SILENT
- See Also:
- Constant Field Values
-
CHARSET
public static final String CHARSET
- See Also:
- Constant Field Values
-
USER_AGENT_CHARSETS
public static final String USER_AGENT_CHARSETS
A comma separated list of patterns and charsets. The pattern is a regular expression. Because different browsers user different encodings this allows for the correct encoding to be selected based on the current browser. In general though it is recommended that BASIC auth not be used when passwords contain characters outside ASCII, as some browsers use the current locate to determine encoding. This list must have an even number of elements, as it is interpreted as pattern,charset,pattern,charset,...- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BasicAuthenticationMechanism
public BasicAuthenticationMechanism(String realmName)
-
BasicAuthenticationMechanism
public BasicAuthenticationMechanism(String realmName, boolean silent)
-
BasicAuthenticationMechanism
public BasicAuthenticationMechanism(String realmName, boolean silent, Charset charset, Map<Pattern,Charset> userAgentCharsets)
-
BasicAuthenticationMechanism
@Deprecated public BasicAuthenticationMechanism(String realmName, String mechanismName)
Deprecated.
-
BasicAuthenticationMechanism
@Deprecated public BasicAuthenticationMechanism(String realmName, String mechanismName, boolean silent)
Deprecated.
-
-
Method Detail
-
authenticate
public io.smallrye.mutiny.Uni<io.quarkus.security.identity.SecurityIdentity> authenticate(io.vertx.ext.web.RoutingContext context, io.quarkus.security.identity.IdentityProviderManager identityProviderManager)- Specified by:
authenticatein interfaceHttpAuthenticationMechanism
-
getChallenge
public io.smallrye.mutiny.Uni<ChallengeData> getChallenge(io.vertx.ext.web.RoutingContext context)
- Specified by:
getChallengein interfaceHttpAuthenticationMechanism
-
getCredentialTypes
public Set<Class<? extends io.quarkus.security.identity.request.AuthenticationRequest>> getCredentialTypes()
Description copied from interface:HttpAuthenticationMechanismReturns the required credential types. If there are no identity managers installed that support the listed types then this mechanism will not be enabled.- Specified by:
getCredentialTypesin interfaceHttpAuthenticationMechanism
-
getCredentialTransport
public HttpCredentialTransport getCredentialTransport()
Description copied from interface:HttpAuthenticationMechanismThe credential transport, used to make sure multiple incompatible mechanisms are not installed May be null if this mechanism cannot interfere with other mechanisms- Specified by:
getCredentialTransportin interfaceHttpAuthenticationMechanism
-
getPriority
public int getPriority()
Description copied from interface:HttpAuthenticationMechanismReturns a priority which determines in which order HttpAuthenticationMechanisms handle the authentication and challenge requests when it is not possible to select the best candidate authentication mechanism based on the request credentials or path specific configuration. Multiple mechanisms are sorted in descending order, so highest priority gets the first chance to send a challenge. The default priority is equal to 1000.- Specified by:
getPriorityin interfaceHttpAuthenticationMechanism- Returns:
- priority
-
-