org.jboss.resteasy.skeleton.key.servlet

## Class ServletOAuthClient

- java.lang.Object
- - org.jboss.resteasy.skeleton.key.AbstractOAuthClient
  - - org.jboss.resteasy.skeleton.key.servlet.ServletOAuthClient

-     public class ServletOAuthClient
      extends AbstractOAuthClient

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    - ### Fields inherited from class org.jboss.resteasy.skeleton.key.AbstractOAuthClient

      `authUrl, client, clientId, codeUrl, counter, password, stateCookieName, truststore`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServletOAuthClient()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getBearerToken(javax.servlet.http.HttpServletRequest request)` Obtain the code parameter from the url after being redirected back from the auth-server.
    `protected String` | `getCode(javax.servlet.http.HttpServletRequest request)`
    `protected String` | `getCookieValue(String name, javax.servlet.http.HttpServletRequest request)`
    `void` | `redirect(String redirectUri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Start the process of obtaining an access token by redirecting the browser to the authentication server
    `void` | `redirectRelative(String relativePath, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Start the process of obtaining an access token by redirecting the browser to the authentication server

    - ### Methods inherited from class org.jboss.resteasy.skeleton.key.AbstractOAuthClient

      `getAuthUrl, getClient, getClientId, getCodeUrl, getPassword, getStateCode, getStateCookieName, getTruststore, resolveBearerToken, setAuthUrl, setClient, setClientId, setCodeUrl, setPassword, setStateCookieName, setTruststore, start, stop, stripOauthParametersFromRedirect`

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

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

- - ### Constructor Detail

    - #### ServletOAuthClient

          public ServletOAuthClient()

  - ### Method Detail

    - #### redirectRelative

          public void redirectRelative(String relativePath,
                              javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                                throws IOException

      Start the process of obtaining an access token by redirecting the browser to the authentication server
      Parameters:
        `relativePath` - path relative to context root you want auth server to redirect back to
        `request` -
        `response` -
      Throws:
        `IOException`

    - #### redirect

          public void redirect(String redirectUri,
                      javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
                        throws IOException

      Start the process of obtaining an access token by redirecting the browser to the authentication server
      Parameters:
        `redirectUri` - full URI you want auth server to redirect back to
        `request` -
        `response` -
      Throws:
        `IOException`

    - #### getCookieValue

          protected String getCookieValue(String name,
                              javax.servlet.http.HttpServletRequest request)

    - #### getCode

          protected String getCode(javax.servlet.http.HttpServletRequest request)

    - #### getBearerToken

          public String getBearerToken(javax.servlet.http.HttpServletRequest request)
                                throws BadRequestException,
                                       InternalServerErrorException

      Obtain the code parameter from the url after being redirected back from the auth-server. Then do an authenticated request back to the auth-server to turn the access code into an access token.
      Parameters:
        `request` -
      Returns:
      Throws:
        `BadRequestException`
        `InternalServerErrorException`

Copyright © 2014. All Rights Reserved.