Class JaasSecurityRealm.JaasSecurityRealmDefaultCallbackHandler

  • All Implemented Interfaces:
    CallbackHandler
    Enclosing class:
    JaasSecurityRealm

    private static class JaasSecurityRealm.JaasSecurityRealmDefaultCallbackHandler
    extends Object
    implements CallbackHandler
    Default CallbackHandler passed to the LoginContext when none is provided to JAAS security realm and none is configured in the "auth.login.defaultCallbackHandler" security property.
    • Field Detail

      • principal

        private final Principal principal
      • evidence

        private final Object evidence
    • Constructor Detail

      • JaasSecurityRealmDefaultCallbackHandler

        private JaasSecurityRealmDefaultCallbackHandler​(Principal principal,
                                                        Evidence evidence)
    • Method Detail

      • getPassword

        private char[] getPassword()
        Source: A utility method for obtaining of password taken from https://github.com/picketbox/picketbox/blob/master/security-jboss-sx/jbosssx/src/main/java/org/jboss/security/auth/callback/JBossCallbackHandler.java on November 2021

        Try to convert the credential value into a char[] using the first of the following attempts which succeeds:

        1. Check for instanceof char[] 2. Check for instanceof String and then use toCharArray() 3. See if credential has a toCharArray() method and use it 4. Use toString() followed by toCharArray().

        Returns:
        a char[] representation of the credential.