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 protectedAuthorizationHeaderBasedHttpAuthenticationScheme(LoginConfiguration loginConfiguration)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidafterProcess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected abstract HttpAuthenticationResultcheckCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, T credentials, Map<String,String> properties)protected abstract TextractCredentials(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 StringgetProtocolName()protected abstract booleanisForcible()protected abstract booleanisProtocolSupported(AuthorizationHeader authorizationHeader)HttpAuthenticationResultprocessAuthenticationRequest(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:HttpAuthenticationProtocolsProviderReturns all authentication protocols those are supported for the specified HTTP request.- Specified by:
getAllowedProtocolsin interfaceHttpAuthenticationProtocolsProvider- Overrides:
getAllowedProtocolsin 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:HttpAuthenticationProtocolsProviderReturns protocols which are used to force authentication when user is not authenticated.- Specified by:
getForcedProtocolsin interfaceHttpAuthenticationProtocolsProvider- Overrides:
getForcedProtocolsin 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:HttpAuthenticationSchemeProcesses 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:
processAuthenticationRequestin interfaceHttpAuthenticationScheme- Overrides:
processAuthenticationRequestin 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
-
-