Module jakarta.mail

Class OAuth2SaslClientFactory

  • All Implemented Interfaces:
    javax.security.sasl.SaslClientFactory

    public class OAuth2SaslClientFactory
    extends java.lang.Object
    implements javax.security.sasl.SaslClientFactory
    Jakarta Mail SASL client factory for OAUTH2.
    Author:
    Bill Shannon
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.security.sasl.SaslClient createSaslClient​(java.lang.String[] mechanisms, java.lang.String authorizationId, java.lang.String protocol, java.lang.String serverName, java.util.Map<java.lang.String,​?> props, javax.security.auth.callback.CallbackHandler cbh)  
      java.lang.String[] getMechanismNames​(java.util.Map<java.lang.String,​?> props)  
      static void init()
      Initialize this OAUTH2 provider, but only if there isn't one already.
      • Methods inherited from class java.lang.Object

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

      • OAuth2SaslClientFactory

        public OAuth2SaslClientFactory()
    • Method Detail

      • createSaslClient

        public javax.security.sasl.SaslClient createSaslClient​(java.lang.String[] mechanisms,
                                                               java.lang.String authorizationId,
                                                               java.lang.String protocol,
                                                               java.lang.String serverName,
                                                               java.util.Map<java.lang.String,​?> props,
                                                               javax.security.auth.callback.CallbackHandler cbh)
                                                        throws javax.security.sasl.SaslException
        Specified by:
        createSaslClient in interface javax.security.sasl.SaslClientFactory
        Throws:
        javax.security.sasl.SaslException
      • getMechanismNames

        public java.lang.String[] getMechanismNames​(java.util.Map<java.lang.String,​?> props)
        Specified by:
        getMechanismNames in interface javax.security.sasl.SaslClientFactory
      • init

        public static void init()
        Initialize this OAUTH2 provider, but only if there isn't one already. If we're not allowed to add this provider, just give up silently.