Class DAORealmHelper

java.lang.Object
sonia.scm.security.DAORealmHelper

public final class DAORealmHelper extends Object
The DAORealmHelper provides a simple way to authenticate against the UserDAO. The class is used by the default and the legacy realm.
Since:
2.0.0
  • Constructor Details

    • DAORealmHelper

      public DAORealmHelper(LoginAttemptHandler loginAttemptHandler, UserDAO userDAO, String realm)
      Constructs a new instance. Consider to use DAORealmHelperFactory which handles dependency injection.
      Parameters:
      loginAttemptHandler - login attempt handler for wrapping credentials matcher
      userDAO - user dao
      realm - name of realm
  • Method Details

    • wrapCredentialsMatcher

      public org.apache.shiro.authc.credential.CredentialsMatcher wrapCredentialsMatcher(org.apache.shiro.authc.credential.CredentialsMatcher credentialsMatcher)
      Wraps credentials matcher and applies login attempt policies.
      Parameters:
      credentialsMatcher - credentials matcher to wrap
      Returns:
      wrapped credentials matcher
    • getAuthenticationInfo

      public org.apache.shiro.authc.AuthenticationInfo getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token)
      Creates AuthenticationInfo from a UsernamePasswordToken. The method accepts AuthenticationInfo as argument, so that the caller does not need to cast.
      Parameters:
      token - authentication token, it must be UsernamePasswordToken
      Returns:
      authentication info
    • authenticationInfoBuilder

      public DAORealmHelper.AuthenticationInfoBuilder authenticationInfoBuilder(String principal)