Class TokenBasedHttpAuthenticationScheme
- 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<BearerTokenCredentials>
-
- jetbrains.buildServer.controllers.interceptors.auth.impl.TokenBasedHttpAuthenticationScheme
-
- All Implemented Interfaces:
HttpAuthenticationProtocolsProvider
,HttpAuthenticationScheme
,PathMatcher
,ProtocolBasedHttpAuthenticationScheme
,AuthModuleType
public class TokenBasedHttpAuthenticationScheme extends AuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
-
-
Constructor Summary
Constructors Constructor Description TokenBasedHttpAuthenticationScheme(LoginConfigurationEx loginConfigurationEx, TokenAuthenticationModel tokenAuthenticationModel)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterProcess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected HttpAuthenticationResult
checkCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, BearerTokenCredentials credentials, Map<String,String> properties)
protected String
doGetName()
protected BearerTokenCredentials
extractCredentials(AuthorizationHeader header)
String
getDisplayName()
Returns name of the authentication module to show in the UIprotected String
getProtocolName()
protected boolean
isForcible()
protected boolean
isProtocolSupported(AuthorizationHeader authorizationHeader)
boolean
matchesPath(String path)
boolean
shouldSkip2FA(javax.servlet.http.HttpServletRequest request, Map<String,String> properties)
Returns whether two-factor authentication should be skipped when this scheme is used.static boolean
tokenAuthWasUsedToLogin(javax.servlet.http.HttpServletRequest request)
-
Methods inherited from class jetbrains.buildServer.controllers.interceptors.auth.impl.AuthorizationHeaderBasedHttpAuthenticationScheme
getAllowedProtocols, getForcedProtocols, processAuthenticationRequest
-
Methods inherited from class jetbrains.buildServer.controllers.interceptors.auth.HttpAuthenticationSchemeAdapter
getName, validate
-
Methods inherited from class jetbrains.buildServer.serverSide.auth.AuthModuleTypeAdapter
describeProperties, getDefaultProperties, getDescription, 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, getEditPropertiesJspFilePath, getName, isMultipleInstancesAllowed, validate
-
-
-
-
Constructor Detail
-
TokenBasedHttpAuthenticationScheme
public TokenBasedHttpAuthenticationScheme(@NotNull LoginConfigurationEx loginConfigurationEx, @NotNull TokenAuthenticationModel tokenAuthenticationModel)
-
-
Method Detail
-
afterProcess
protected void afterProcess(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull javax.servlet.http.HttpServletResponse response)
- Overrides:
afterProcess
in classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
-
getProtocolName
protected String getProtocolName()
- Specified by:
getProtocolName
in classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
-
extractCredentials
protected BearerTokenCredentials extractCredentials(@NotNull AuthorizationHeader header) throws AuthenticationFailedException
- Specified by:
extractCredentials
in classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
- Throws:
AuthenticationFailedException
-
matchesPath
public boolean matchesPath(@NotNull String path)
-
isProtocolSupported
protected boolean isProtocolSupported(@Nullable AuthorizationHeader authorizationHeader)
- Specified by:
isProtocolSupported
in classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
-
isForcible
protected boolean isForcible()
- Specified by:
isForcible
in classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
-
checkCredentials
@NotNull protected HttpAuthenticationResult checkCredentials(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull javax.servlet.http.HttpServletResponse response, @NotNull BearerTokenCredentials credentials, @NotNull Map<String,String> properties)
- Specified by:
checkCredentials
in classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
-
shouldSkip2FA
public boolean shouldSkip2FA(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull Map<String,String> properties)
Description copied from interface:HttpAuthenticationScheme
Returns whether two-factor authentication should be skipped when this scheme is used.- Parameters:
request
- requestproperties
- properties from config file- Returns:
- true if two-factor authentication should be skipped, false otherwise
-
doGetName
@NotNull protected String doGetName()
- Specified by:
doGetName
in classHttpAuthenticationSchemeAdapter
-
getDisplayName
@NotNull public String getDisplayName()
Description copied from interface:AuthModuleType
Returns name of the authentication module to show in the UI- Specified by:
getDisplayName
in interfaceAuthModuleType
- Overrides:
getDisplayName
in classAuthModuleTypeAdapter
- Returns:
- name of the authentication module to show in the UI
-
tokenAuthWasUsedToLogin
public static boolean tokenAuthWasUsedToLogin(@NotNull javax.servlet.http.HttpServletRequest request)
-
-