Class BambooAuthenticator

java.lang.Object
com.atlassian.seraph.auth.AbstractAuthenticator
com.atlassian.seraph.auth.DefaultAuthenticator
com.atlassian.crowd.integration.seraph.CrowdAuthenticator
com.atlassian.crowd.integration.seraph.v25.BambooAuthenticator
All Implemented Interfaces:
com.atlassian.seraph.auth.Authenticator, com.atlassian.seraph.Initable, Serializable

public class BambooAuthenticator extends com.atlassian.crowd.integration.seraph.CrowdAuthenticator
A Seraph Authenticator that works against Crowd and enables single sign-on. This is not currently dynamic; it will only pick up configuration changes to the Crowd client properties when Bamboo is restarted. It will only work against Crowd, not against JIRA. This class is referenced in Bamboo + Crowd SSO documentation: https://confluence.atlassian.com/crowd/integrating-crowd-with-atlassian-bamboo-198785.html
See Also:
  • Field Summary

    Fields inherited from class com.atlassian.crowd.integration.seraph.CrowdAuthenticator

    logger, PASSWORD_RESET_REQUIRED_HEADER

    Fields inherited from class com.atlassian.seraph.auth.DefaultAuthenticator

    LOGGED_IN_KEY, LOGGED_IN_USER_ID_KEY, LOGGED_OUT_KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Principal
    getUser(String username)
     
    getUser(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     
    void
    init(Map<String,String> params, com.atlassian.seraph.config.SecurityConfig config)
     
    boolean
    login(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String username, String password, boolean cookie)
     
    boolean
    logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     
    protected void
    logoutUser(javax.servlet.http.HttpServletRequest request)
    Clear the Acegi security context in Bamboo and replace it with an AnonymousAuthenticationToken.

    Methods inherited from class com.atlassian.crowd.integration.seraph.CrowdAuthenticator

    authenticate, checkAuthenticated, checkRememberMeLoginToCrowd, fetchUserInCache, isAuthenticated, rememberMeLoginToCrowd

    Methods inherited from class com.atlassian.seraph.auth.DefaultAuthenticator

    authoriseUserAndEstablishSession, getAuthType, getElevatedSecurityGuard, getLogoutInterceptors, getPrincipalFromSession, getRememberMeService, getRoleMapper, getUserFromBasicAuthentication, getUserFromCookie, getUserFromSession, isAuthorised, isPrincipalAlreadyInSessionContext, putPrincipalInSessionContext, refreshPrincipalObtainedFromSession, removePrincipalFromSessionContext

    Methods inherited from class com.atlassian.seraph.auth.AbstractAuthenticator

    destroy, getConfig, getRemoteUser, getUser, login

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BambooAuthenticator

      public BambooAuthenticator()
  • Method Details

    • init

      public void init(Map<String,String> params, com.atlassian.seraph.config.SecurityConfig config)
      Specified by:
      init in interface com.atlassian.seraph.Initable
      Overrides:
      init in class com.atlassian.seraph.auth.DefaultAuthenticator
    • login

      public boolean login(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String username, String password, boolean cookie) throws com.atlassian.seraph.auth.AuthenticatorException
      Specified by:
      login in interface com.atlassian.seraph.auth.Authenticator
      Overrides:
      login in class com.atlassian.crowd.integration.seraph.CrowdAuthenticator
      Throws:
      com.atlassian.seraph.auth.AuthenticatorException
    • getUser

      protected Principal getUser(String username)
      Specified by:
      getUser in class com.atlassian.seraph.auth.DefaultAuthenticator
    • getUser

      public Principal getUser(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Specified by:
      getUser in interface com.atlassian.seraph.auth.Authenticator
      Overrides:
      getUser in class com.atlassian.crowd.integration.seraph.CrowdAuthenticator
    • logout

      public boolean logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws com.atlassian.seraph.auth.AuthenticatorException
      Specified by:
      logout in interface com.atlassian.seraph.auth.Authenticator
      Overrides:
      logout in class com.atlassian.crowd.integration.seraph.CrowdAuthenticator
      Throws:
      com.atlassian.seraph.auth.AuthenticatorException
    • logoutUser

      protected void logoutUser(javax.servlet.http.HttpServletRequest request)
      Clear the Acegi security context in Bamboo and replace it with an AnonymousAuthenticationToken.
      Specified by:
      logoutUser in class com.atlassian.crowd.integration.seraph.CrowdAuthenticator