org.apache.activemq.artemis.spi.core.security.jaas

## Class SCRAMPropertiesLoginModule

- java.lang.Object
- - org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoader
  - - org.apache.activemq.artemis.spi.core.security.jaas.SCRAMPropertiesLoginModule

- All Implemented Interfaces:
    LoginModule, AuditLoginModule

      public class SCRAMPropertiesLoginModule
      extends PropertiesLoader
      implements AuditLoginModule

  Login modules that uses properties files similar to the `PropertiesLoginModule`. It can either store the username-password in plain text or in an encrypted/hashed form. the `main(String[])` method provides a way to prepare unencrypted data to be encrypted/hashed.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoader

      `PropertiesLoader.FileNameKey`

  - ### Field Summary

    - ### Fields inherited from class org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoader

      `debug`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SCRAMPropertiesLoginModule()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `abort()`
    `boolean` | `commit()`
    `void` | `initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)`
    `boolean` | `login()`
    `boolean` | `logout()`
    `static void` | `main(String[] args)` Main method that could be used to encrypt given credentials for use in properties files

    - ### Methods inherited from class org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoader

      `init, load, resetUsersAndGroupsCache`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.activemq.artemis.spi.core.security.jaas.AuditLoginModule

      `registerFailureForAudit`

- - ### Constructor Detail

    - #### SCRAMPropertiesLoginModule

          public SCRAMPropertiesLoginModule()

  - ### Method Detail

    - #### initialize

          public void initialize(Subject subject,
                                 CallbackHandler callbackHandler,
                                 Map<String,?> sharedState,
                                 Map<String,?> options)

      Specified by:
        `initialize` in interface `LoginModule`

    - #### login

          public boolean login()
                        throws LoginException

      Specified by:
        `login` in interface `LoginModule`
      Throws:
        `LoginException`

    - #### commit

          public boolean commit()
                         throws LoginException

      Specified by:
        `commit` in interface `LoginModule`
      Throws:
        `LoginException`

    - #### abort

          public boolean abort()
                        throws LoginException

      Specified by:
        `abort` in interface `LoginModule`
      Throws:
        `LoginException`

    - #### logout

          public boolean logout()
                         throws LoginException

      Specified by:
        `logout` in interface `LoginModule`
      Throws:
        `LoginException`

    - #### main

          public static void main(String[] args)
                           throws GeneralSecurityException,
                                  ScramException,
                                  StringPrep.StringPrepError,
                                  IOException

      Main method that could be used to encrypt given credentials for use in properties files
      Parameters:
        `args` - username password type [iterations]
      Throws:
        `GeneralSecurityException` - if any security mechanism is not available on this JVM
        `ScramException` - if invalid data is supplied
        `StringPrep.StringPrepError` - if username can't be encoded according to SASL StringPrep
        `IOException` - if writing as properties failed

Copyright © 2021 The Apache Software Foundation. All rights reserved.