Class AuthDescriptor


  • public class AuthDescriptor
    extends java.lang.Object
    Information required to specify authentication mechanisms and callbacks.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int allowedAuthAttempts  
      private int authAttempts  
      private javax.security.auth.callback.CallbackHandler cbh  
      private java.lang.String[] mechs  
    • Constructor Summary

      Constructors 
      Constructor Description
      AuthDescriptor​(java.lang.String[] m, javax.security.auth.callback.CallbackHandler h)
      Request authentication using the given list of mechanisms and callback handler.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean authThresholdReached()  
      javax.security.auth.callback.CallbackHandler getCallback()  
      java.lang.String[] getMechs()  
      static AuthDescriptor typical​(java.lang.String u, java.lang.String p)
      Get a typical auth descriptor for CRAM-MD5 or PLAIN auth with the given username and password.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mechs

        private final java.lang.String[] mechs
      • cbh

        private final javax.security.auth.callback.CallbackHandler cbh
      • authAttempts

        private int authAttempts
      • allowedAuthAttempts

        private int allowedAuthAttempts
    • Constructor Detail

      • AuthDescriptor

        public AuthDescriptor​(java.lang.String[] m,
                              javax.security.auth.callback.CallbackHandler h)
        Request authentication using the given list of mechanisms and callback handler.

        If the list of mechanisms is empty, then the client will try to fetch a list of supported SASL mechanisms from the server. If this is not supported by the server or a specific method needs to be forced, passing a specific list of mechanisms in will work.

        For example, if the server would support CRAM-MD5 and PLAIN, the most secure variant (CRAM-MD5) will be chosen by default. If PLAIN should be used instead, passing in new String[] {"PLAIN"} will force the client to use PLAIN.

        Parameters:
        m - list of mechanisms
        h - the callback handler for grabbing credentials and stuff
    • Method Detail

      • typical

        public static AuthDescriptor typical​(java.lang.String u,
                                             java.lang.String p)
        Get a typical auth descriptor for CRAM-MD5 or PLAIN auth with the given username and password.
        Parameters:
        u - the username
        p - the password
        Returns:
        an AuthDescriptor
      • authThresholdReached

        public boolean authThresholdReached()
      • getMechs

        public java.lang.String[] getMechs()
      • getCallback

        public javax.security.auth.callback.CallbackHandler getCallback()