Class LoginModuleUtil

    • Field Detail

      • USER_MODEL_KEY

        @NotNull
        public static final java.lang.String USER_MODEL_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • LoginModuleUtil

        public LoginModuleUtil()
    • Method Detail

      • getUserModel

        @NotNull
        public static UserModel getUserModel​(@NotNull
                                             java.util.Map<java.lang.String,​?> jaasOptions)
        Extracts user model from JAAS options (it is always put there by system, so it is safe to call this method).
        Parameters:
        jaasOptions - JAAS options
        Returns:
        user model
        See Also:
        LoginModuleDescriptor, LoginModule
      • getObject

        @NotNull
        public static <T> T getObject​(@NotNull
                                      java.util.Map<java.lang.String,​?> jaasOptions,
                                      @NotNull
                                      java.lang.String key,
                                      @NotNull
                                      java.lang.String description,
                                      @NotNull
                                      java.lang.Class<T> objectClass)
        Extracts object of the specified type from JAAS options.
        Parameters:
        jaasOptions - JAAS options
        key - option key
        description - object description to include in exception text if it is not found
        objectClass - type of the object
        Returns:
        object of the specified type
        Throws:
        java.lang.RuntimeException - if object is not found by the specified key or has wrong type