Class AuthenticationInfo

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.Object>

    @Deprecated(since="2015")
    public class AuthenticationInfo
    extends java.util.HashMap<java.lang.String,​java.lang.Object>
    Deprecated.
    Use Apache Sling's org.apache.sling.auth.core.spi package instead.
    The AuthenticationInfo conveys any authentication credentials and/or details extracted by the AuthenticationHandler.extractCredentials(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) method from the request.

    AuthenticationHandler implementations must return instances of this class which may be constructed through any of the provided public constructors.

    Internally all values are stored in the map where some property names have special semantics and the data type of the properties are ensured by the put(String, Object) method implementation.

    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      AuthenticationInfo​(java.lang.String authType)
      Deprecated.
      Creates an instance of this class with just the authentication type.
      AuthenticationInfo​(java.lang.String authType, java.lang.String userId)
      Deprecated.
      Creates an instance of this class authenticating with the given type and userid.
      AuthenticationInfo​(java.lang.String authType, java.lang.String userId, char[] password)
      Deprecated.
      Creates an instance of this class authenticating with the given type and userid/password connecting.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void clear()
      Deprecated.
      Clears all properties from the map with the exception of the AUTH_TYPE property.
      java.lang.String getAuthType()
      Deprecated.
      Returns the authentication type stored as the AUTH_TYPE property in this map.
      char[] getPassword()
      Deprecated.
      Returns the password stored as the PASSWORD property or null if the password is not set in this map.
      java.lang.String getUser()
      Deprecated.
      Returns the user name stored as the USER property or null if the user is not set in this map.
      java.lang.Object put​(java.lang.String key, java.lang.Object value)
      Deprecated.
      Sets or resets a property with the given key to a new value.
      java.lang.Object remove​(java.lang.Object key)
      Deprecated.
      Removes the entry with the given key and returns its former value (if existing).
      void setAuthType​(java.lang.String authType)
      Deprecated.
       
      void setPassword​(char[] password)
      Deprecated.
       
      void setUser​(java.lang.String user)
      Deprecated.
       
      • Methods inherited from class java.util.HashMap

        clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        equals, hashCode
    • Constructor Detail

      • AuthenticationInfo

        public AuthenticationInfo​(java.lang.String authType)
        Deprecated.
        Creates an instance of this class with just the authentication type. To effectively use this instance the user Id with optional password and/or the credentials should be set.
        Parameters:
        authType - The authentication type, must not be null.
      • AuthenticationInfo

        public AuthenticationInfo​(java.lang.String authType,
                                  java.lang.String userId)
        Deprecated.
        Creates an instance of this class authenticating with the given type and userid.
        Parameters:
        authType - The authentication type, must not be null.
        userId - The name of the user to authenticate as. This may be null for the constructor and later be set.
        Throws:
        java.lang.NullPointerException - if authType is null.
      • AuthenticationInfo

        public AuthenticationInfo​(java.lang.String authType,
                                  java.lang.String userId,
                                  char[] password)
        Deprecated.
        Creates an instance of this class authenticating with the given type and userid/password connecting.
        Parameters:
        authType - The authentication type, must not be null.
        userId - The name of the user to authenticate as. This may be null for the constructor and later be set.
        password - The password to authenticate with or null if no password can be supplied.
        Throws:
        java.lang.NullPointerException - if authType is null.
    • Method Detail

      • setAuthType

        public final void setAuthType​(java.lang.String authType)
        Deprecated.
        Parameters:
        authType - The authentication type to set. If this is null the current authentication type is not replaced.
      • getAuthType

        public final java.lang.String getAuthType()
        Deprecated.
        Returns the authentication type stored as the AUTH_TYPE property in this map. This value is expected to never be null.

        If authentication is taking place through one of the standard ways, such as Basic or Digest, the return value is one of the predefined constants of the HttpServletRequest interface. Otherwise the value may be specific to the AuthenticationHandler implementation.

      • setUser

        public final void setUser​(java.lang.String user)
        Deprecated.
        Parameters:
        user - The name of the user to authenticate as. If this is null the current user name is not replaced.
      • getUser

        public final java.lang.String getUser()
        Deprecated.
        Returns the user name stored as the USER property or null if the user is not set in this map.
      • setPassword

        public final void setPassword​(char[] password)
        Deprecated.
        Parameters:
        password - The password to authenticate with. If this is null the current password is not replaced.
      • getPassword

        public final char[] getPassword()
        Deprecated.
        Returns the password stored as the PASSWORD property or null if the password is not set in this map.
      • put

        public java.lang.Object put​(java.lang.String key,
                                    java.lang.Object value)
        Deprecated.
        Sets or resets a property with the given key to a new value. Some keys have special meanings and their values are required to have predefined as listed in the following table:
        AUTH_TYPE String
        USER String
        PASSWORD char[]
        CREDENTIALS javax.jcr.Credentials

        If the value for the special key does not match the required type an IllegalArgumentException is thrown.

        Specified by:
        put in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        put in class java.util.HashMap<java.lang.String,​java.lang.Object>
        Parameters:
        key - The name of the property to set
        value - The value of the property which must be of a special type if the key designates one of the predefined properties.
        Returns:
        The value previously set for the given key.
        Throws:
        java.lang.IllegalArgumentException - if key designates one of the special properties and the value does not have the correct type for the respective key.
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        Deprecated.
        Removes the entry with the given key and returns its former value (if existing). If the key is AUTH_TYPE the value is not actually removed and null is always returned.
        Specified by:
        remove in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        remove in class java.util.HashMap<java.lang.String,​java.lang.Object>
        Parameters:
        key - Removes the value associated with this key.
        Returns:
        The former value associated with the key.
      • clear

        public void clear()
        Deprecated.
        Clears all properties from the map with the exception of the AUTH_TYPE property.
        Specified by:
        clear in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        clear in class java.util.HashMap<java.lang.String,​java.lang.Object>