Package org.apache.storm.security.auth.workertoken

# Class WorkerTokenClientCallbackHandler

java.lang.Object
org.apache.storm.security.auth.sasl.SimpleSaslClientCallbackHandler
org.apache.storm.security.auth.workertoken.WorkerTokenClientCallbackHandler

All Implemented Interfaces:
  `CallbackHandler`

public class WorkerTokenClientCallbackHandler extends SimpleSaslClientCallbackHandler
A Client callback handler for a WorkerToken. In general a client that wants to support worker tokens should first check if a WorkerToken is available for the specific connection type by calling findWorkerTokenInSubject. If that returns a token, then proceed to create and use this with a DIGEST-MD5 SaslClient. If not you should fall back to whatever other client auth you want to do.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WorkerTokenClientCallbackHandler(WorkerToken token)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static WorkerToken`
  `findWorkerTokenInSubject(ThriftConnectionType type)`
  Look in the current subject for a WorkerToken.

  ### Methods inherited from class org.apache.storm.security.auth.sasl.SimpleSaslClientCallbackHandler

  `handle`

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

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

- ## Constructor Details

  - ### WorkerTokenClientCallbackHandler

    public WorkerTokenClientCallbackHandler(WorkerToken token)
    Constructor.
    Parameters:
      `token` - the token to use to authenticate. This was probably retrieved by calling findWorkerTokenInSubject.

- ## Method Details

  - ### findWorkerTokenInSubject

    public static WorkerToken findWorkerTokenInSubject(ThriftConnectionType type)
    Look in the current subject for a WorkerToken. This should really only happen when we are in a worker, because the tokens will not be placed in anything else.
    Parameters:
      `type` - the type of connection we need a token for.
    Returns:
      the found token or null.