Class AuthenticationService


  • @RequestScoped
    public class AuthenticationService
    extends java.lang.Object
    Authentication service methods
    Version:
    November 23, 2017
    Author:
    Yuriy Movchan, Javier Rojas Blum
    • Constructor Detail

      • AuthenticationService

        public AuthenticationService()
    • Method Detail

      • authenticate

        public boolean authenticate​(java.lang.String userName,
                                    java.lang.String password)
        Authenticate user.
        Parameters:
        userName - The username.
        password - The user's password.
        Returns:
        true if success, otherwise false.
      • authenticate

        public boolean authenticate​(java.lang.String nameValue,
                                    java.lang.String password,
                                    java.lang.String... nameAttributes)
        Authenticate user.
        Parameters:
        nameValue - The name value to find user
        password - The user's password.
        nameAttributes - List of attribute to search.
        Returns:
        true if success, otherwise false.
      • authenticate

        public boolean authenticate​(java.lang.String keyValue,
                                    java.lang.String password,
                                    java.lang.String primaryKey,
                                    java.lang.String localPrimaryKey)
      • authenticate

        public boolean authenticate​(org.gluu.model.ldap.GluuLdapConfiguration ldapAuthConfig,
                                    org.gluu.persist.PersistenceEntryManager ldapAuthEntryManager,
                                    java.lang.String keyValue,
                                    java.lang.String password,
                                    java.lang.String primaryKey,
                                    java.lang.String localPrimaryKey)
      • authenticate

        public boolean authenticate​(org.gluu.model.ldap.GluuLdapConfiguration ldapAuthConfig,
                                    org.gluu.persist.PersistenceEntryManager ldapAuthEntryManager,
                                    java.lang.String keyValue,
                                    java.lang.String password,
                                    java.lang.String primaryKey,
                                    java.lang.String localPrimaryKey,
                                    boolean updateMetrics)
      • authenticate

        public boolean authenticate​(java.lang.String userName)
      • configureSessionUser

        public SessionId configureSessionUser​(SessionId sessionId,
                                              java.util.Map<java.lang.String,​java.lang.String> sessionIdAttributes)
      • configureEventUser

        public SessionId configureEventUser()
      • configureEventUser

        public void configureEventUser​(SessionId sessionId)
      • quietLogin

        public void quietLogin​(java.lang.String userName)
      • getAuthenticatedUser

        public User getAuthenticatedUser()
      • getAuthenticatedUserId

        public java.lang.String getAuthenticatedUserId()
      • configureSessionClient

        public Client configureSessionClient()
      • configureSessionClient

        public void configureSessionClient​(Client client)
      • onSuccessfulLogin

        public void onSuccessfulLogin​(SessionId sessionUser)
      • getUserOrRemoveSession

        public User getUserOrRemoveSession​(SessionId p_sessionId)
      • parametersAsString

        public java.lang.String parametersAsString()
                                            throws java.io.UnsupportedEncodingException
        Throws:
        java.io.UnsupportedEncodingException
      • getParametersMap

        public java.util.Map<java.lang.String,​java.lang.String> getParametersMap​(java.util.List<java.lang.String> extraParameters)
      • isParameterExists

        public boolean isParameterExists​(java.lang.String p_name)
      • updateExtraParameters

        public void updateExtraParameters​(java.util.Map<java.lang.String,​java.lang.String> sessionIdAttributes,
                                          java.util.List<java.lang.String> extraParameters)
      • getExternalScriptExtraParameters

        public java.util.Map<java.lang.String,​java.lang.String> getExternalScriptExtraParameters​(java.util.Map<java.lang.String,​java.lang.String> sessionIdAttributes)
      • setExternalScriptExtraParameters

        public void setExternalScriptExtraParameters​(java.util.Map<java.lang.String,​java.lang.String> sessionIdAttributes,
                                                     java.util.Map<java.lang.String,​java.lang.String> authExternalAttributes)
      • clearExternalScriptExtraParameters

        public void clearExternalScriptExtraParameters​(java.util.Map<java.lang.String,​java.lang.String> sessionIdAttributes)
      • copyAuthenticatorExternalAttributes

        public void copyAuthenticatorExternalAttributes​(SessionId oldSession,
                                                        SessionId newSession)