Package com.sun.mail.auth

## Class OAuth2SaslClientFactory

- java.lang.Object
- - com.sun.mail.auth.OAuth2SaslClientFactory

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

    public class OAuth2SaslClientFactory
    extends java.lang.Object
    implements javax.security.sasl.SaslClientFactory

JavaMail SASL client factory for OAUTH2.

Author:
  Bill Shannon

### Constructor Summary

Constructors
`OAuth2SaslClientFactory()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`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.