com.h3c.keystone

## Class HttpAuthClient

- java.lang.Object
- - com.h3c.keystone.HttpAuthClient

- All Implemented Interfaces:
    AuthenticationService, AuthenticationClient

      public class HttpAuthClient
      extends Object
      implements AuthenticationClient

  An `AuthenticationClient` adapter for HTTP.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpAuthClient(org.apache.http.client.HttpClient client, String adminToken, URI uri)` Creates a client that uses HTTP to authenticate a token.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Authentication` | `authenticate(String domain, String user, String password)` Authenticate against the specified domain using the supplied user name and password.
    `void` | `invalidate(String token)` Invalidates the specified authentication token.
    `Authentication` | `validate(String token)` Determines whether the specified authentication token is valid and if so, provides the associated authentication data.

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

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

- - ### Constructor Detail

    - #### HttpAuthClient

          public HttpAuthClient(org.apache.http.client.HttpClient client,
                        String adminToken,
                        URI uri)

      Creates a client that uses HTTP to authenticate a token.
      Parameters:
        `client` - HTTP client to be used
        `adminToken` - admin token to be used for validating other tokens
        `uri` - base authentication service URI

  - ### Method Detail

    - #### authenticate

          public Authentication authenticate(String domain,
                                    String user,
                                    String password)

      Description copied from interface: `AuthenticationService`
      Authenticate against the specified domain using the supplied user name and password.
      Specified by:
        `authenticate` in interface `AuthenticationService`
      Parameters:
        `domain` - authentication domain
        `user` - user name
        `password` - user password
      Returns:
        authentication containing unique identifying token and associated authentication information

    - #### validate

          public Authentication validate(String token)

      Description copied from interface: `AuthenticationService`
      Determines whether the specified authentication token is valid and if so, provides the associated authentication data.
      Specified by:
        `validate` in interface `AuthenticationService`
      Parameters:
        `token` - token to be validated
      Returns:
        authentication data associated with the given token via prior call to `AuthenticationService.authenticate(String, String, String)`

    - #### invalidate

          public void invalidate(String token)

      Description copied from interface: `AuthenticationService`
      Invalidates the specified authentication token.
      Specified by:
        `invalidate` in interface `AuthenticationService`
      Parameters:
        `token` - token to be invalidated

Copyright © 2014. All Rights Reserved.