Class AuthorizationHeaderBasedHttpAuthenticationScheme<T extends SimpleCredentials>
- java.lang.Object
-
- jetbrains.buildServer.serverSide.auth.AuthModuleTypeAdapter
-
- jetbrains.buildServer.controllers.interceptors.auth.HttpAuthenticationSchemeAdapter
-
- jetbrains.buildServer.controllers.interceptors.auth.ProtocolBasedHttpAuthenticationSchemeAdapter
-
- jetbrains.buildServer.controllers.interceptors.auth.impl.AuthorizationHeaderBasedHttpAuthenticationScheme<T>
-
- All Implemented Interfaces:
HttpAuthenticationProtocolsProvider
,HttpAuthenticationScheme
,PathMatcher
,ProtocolBasedHttpAuthenticationScheme
,AuthModuleType
- Direct Known Subclasses:
BasicProtocolBasedHttpAuthenticationScheme
,TokenBasedHttpAuthenticationScheme
public abstract class AuthorizationHeaderBasedHttpAuthenticationScheme<T extends SimpleCredentials> extends ProtocolBasedHttpAuthenticationSchemeAdapter implements PathMatcher
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AuthorizationHeaderBasedHttpAuthenticationScheme(LoginConfiguration loginConfiguration)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
afterProcess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected abstract HttpAuthenticationResult
checkCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, T credentials, Map<String,String> properties)
protected abstract T
extractCredentials(AuthorizationHeader header)
Set<HttpAuthenticationProtocol>
getAllowedProtocols(javax.servlet.http.HttpServletRequest request, Map<String,String> properties)
Returns all authentication protocols those are supported for the specified HTTP request.Set<HttpAuthenticationProtocol>
getForcedProtocols(javax.servlet.http.HttpServletRequest request, Map<String,String> properties)
Returns protocols which are used to force authentication when user is not authenticated.protected abstract String
getProtocolName()
protected abstract boolean
isForcible()
protected abstract boolean
isProtocolSupported(AuthorizationHeader authorizationHeader)
HttpAuthenticationResult
processAuthenticationRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,String> properties)
Processes authentication request.
If the request does not correspond to this scheme, method must return HttpAuthenticationResult.notApplicable().
If response object is changed inside the method, method must return HttpAuthenticationResult.unauthenticated().-
Methods inherited from class jetbrains.buildServer.controllers.interceptors.auth.HttpAuthenticationSchemeAdapter
doGetName, getName, validate
-
Methods inherited from class jetbrains.buildServer.serverSide.auth.AuthModuleTypeAdapter
describeProperties, getDefaultProperties, getDescription, getDisplayName, getEditPropertiesJspFilePath, isMultipleInstancesAllowed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.auth.AuthModuleType
describeProperties, getDefaultProperties, getDescription, getDisplayName, getEditPropertiesJspFilePath, getName, isMultipleInstancesAllowed, validate
-
Methods inherited from interface jetbrains.buildServer.controllers.interceptors.auth.HttpAuthenticationScheme
shouldSkip2FA
-
Methods inherited from interface jetbrains.buildServer.controllers.interceptors.auth.PathMatcher
matchesPath
-
-
-
-
Constructor Detail
-
AuthorizationHeaderBasedHttpAuthenticationScheme
protected AuthorizationHeaderBasedHttpAuthenticationScheme(@Nullable LoginConfiguration loginConfiguration)
-
-
Method Detail
-
afterProcess
protected void afterProcess(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull javax.servlet.http.HttpServletResponse response)
-
getAllowedProtocols
@NotNull public Set<HttpAuthenticationProtocol> getAllowedProtocols(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull Map<String,String> properties)
Description copied from interface:HttpAuthenticationProtocolsProvider
Returns all authentication protocols those are supported for the specified HTTP request.- Specified by:
getAllowedProtocols
in interfaceHttpAuthenticationProtocolsProvider
- Overrides:
getAllowedProtocols
in classProtocolBasedHttpAuthenticationSchemeAdapter
- Parameters:
request
- requestproperties
- properties from config file- Returns:
- allowed protocols
-
getForcedProtocols
@NotNull public Set<HttpAuthenticationProtocol> getForcedProtocols(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull Map<String,String> properties)
Description copied from interface:HttpAuthenticationProtocolsProvider
Returns protocols which are used to force authentication when user is not authenticated.- Specified by:
getForcedProtocols
in interfaceHttpAuthenticationProtocolsProvider
- Overrides:
getForcedProtocols
in classProtocolBasedHttpAuthenticationSchemeAdapter
- Parameters:
request
- requestproperties
- properties from config file- Returns:
- forced protocols
-
processAuthenticationRequest
@NotNull public HttpAuthenticationResult processAuthenticationRequest(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull javax.servlet.http.HttpServletResponse response, @NotNull Map<String,String> properties) throws IOException
Description copied from interface:HttpAuthenticationScheme
Processes authentication request.
If the request does not correspond to this scheme, method must return HttpAuthenticationResult.notApplicable().
If response object is changed inside the method, method must return HttpAuthenticationResult.unauthenticated().- Specified by:
processAuthenticationRequest
in interfaceHttpAuthenticationScheme
- Overrides:
processAuthenticationRequest
in classHttpAuthenticationSchemeAdapter
- Parameters:
request
- requestresponse
- responseproperties
- properties from config file- Returns:
- result of processing, see above
- Throws:
IOException
- if some I/O error occurred
-
isProtocolSupported
protected abstract boolean isProtocolSupported(@Nullable AuthorizationHeader authorizationHeader)
-
isForcible
protected abstract boolean isForcible()
-
getProtocolName
protected abstract String getProtocolName()
-
extractCredentials
protected abstract T extractCredentials(@NotNull AuthorizationHeader header) throws AuthenticationFailedException
- Throws:
AuthenticationFailedException
-
checkCredentials
@NotNull protected abstract HttpAuthenticationResult checkCredentials(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull javax.servlet.http.HttpServletResponse response, @NotNull T credentials, @NotNull Map<String,String> properties) throws IOException
- Throws:
IOException
-
-