Skip navigation links
org.apache.catalina.realm

Class JAASRealm

    • Field Detail

      • appName

        protected String appName
        The application name passed to the JAAS LoginContext, which uses it to select the set of relevant LoginModules.
      • roleClasses

        protected ArrayList<String> roleClasses
        The list of role class names, split out for easy processing.
      • userClasses

        protected ArrayList<String> userClasses
        The set of user class names, split out for easy processing.
      • roleClassNames

        protected String roleClassNames
        Comma-delimited list of javax.security.Principal classes that represent security roles.
      • userClassNames

        protected String userClassNames
        Comma-delimited list of javax.security.Principal classes that represent individual users.
    • Constructor Detail

      • JAASRealm

        public JAASRealm()
    • Method Detail

      • setAppName

        public void setAppName(String name)
        Deprecated. JAAS should use the Engine ( domain ) name and webpp/host overrides
        setter for the appName member variable
      • getAppName

        public String getAppName()
        getter for the appName member variable
      • setContainer

        public void setContainer(Container container)
        Description copied from class: RealmBase
        Set the Container with which this Realm has been associated.
        Specified by:
        setContainer in interface Realm
        Overrides:
        setContainer in class RealmBase
        Parameters:
        container - The associated Container
      • getRoleClassNames

        public String getRoleClassNames()
      • setRoleClassNames

        public void setRoleClassNames(String roleClassNames)
      • getUserClassNames

        public String getUserClassNames()
      • setUserClassNames

        public void setUserClassNames(String userClassNames)
      • authenticate

        public Principal authenticate(String username,
                                      char[] credentials)
        Return the Principal associated with the specified username and credentials, if there is one; otherwise return null. If there are any errors with the JDBC connection, executing the query or anything we return null (don't authenticate). This event is also logged, and the connection will be closed so that a subsequent request will automatically re-open it.
        Specified by:
        authenticate in interface Realm
        Overrides:
        authenticate in class RealmBase
        Parameters:
        username - Username of the Principal to look up
        credentials - Password or other credentials to use in authenticating this username
      • getName

        protected String getName()
        Return a short name for this Realm implementation.
        Specified by:
        getName in class RealmBase
      • getPassword

        protected char[] getPassword(String username)
        Return the password associated with the given principal's user name.
        Specified by:
        getPassword in class RealmBase
      • createPrincipal

        protected Principal createPrincipal(String username,
                                            Subject subject)
        Construct and return a java.security.Principal instance representing the authenticated user for the specified Subject. If no such Principal can be constructed, return null.
        Parameters:
        subject - The Subject representing the logged in user

Copyright © 2017. All rights reserved.