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 voidafterProcess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected HttpAuthenticationResultcheckCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, BearerTokenCredentials credentials, Map<String,String> properties)protected StringdoGetName()protected BearerTokenCredentialsextractCredentials(AuthorizationHeader header)StringgetDisplayName()Returns name of the authentication module to show in the UIprotected StringgetProtocolName()protected booleanisForcible()protected booleanisProtocolSupported(AuthorizationHeader authorizationHeader)booleanmatchesPath(String path)booleanshouldSkip2FA(javax.servlet.http.HttpServletRequest request, Map<String,String> properties)Returns whether two-factor authentication should be skipped when this scheme is used.static booleantokenAuthWasUsedToLogin(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:
afterProcessin classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
-
getProtocolName
protected String getProtocolName()
- Specified by:
getProtocolNamein classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
-
extractCredentials
protected BearerTokenCredentials extractCredentials(@NotNull AuthorizationHeader header) throws AuthenticationFailedException
- Specified by:
extractCredentialsin classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>- Throws:
AuthenticationFailedException
-
matchesPath
public boolean matchesPath(@NotNull String path)
-
isProtocolSupported
protected boolean isProtocolSupported(@Nullable AuthorizationHeader authorizationHeader)- Specified by:
isProtocolSupportedin classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
-
isForcible
protected boolean isForcible()
- Specified by:
isForciblein 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:
checkCredentialsin classAuthorizationHeaderBasedHttpAuthenticationScheme<BearerTokenCredentials>
-
shouldSkip2FA
public boolean shouldSkip2FA(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull Map<String,String> properties)Description copied from interface:HttpAuthenticationSchemeReturns 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:
doGetNamein classHttpAuthenticationSchemeAdapter
-
getDisplayName
@NotNull public String getDisplayName()
Description copied from interface:AuthModuleTypeReturns name of the authentication module to show in the UI- Specified by:
getDisplayNamein interfaceAuthModuleType- Overrides:
getDisplayNamein classAuthModuleTypeAdapter- Returns:
- name of the authentication module to show in the UI
-
tokenAuthWasUsedToLogin
public static boolean tokenAuthWasUsedToLogin(@NotNull javax.servlet.http.HttpServletRequest request)
-
-