org.keycloak.jaxrs

## Class JaxrsOAuthClient

- java.lang.Object
- - org.keycloak.AbstractOAuthClient
  - - org.keycloak.jaxrs.JaxrsOAuthClient

-     public class JaxrsOAuthClient
      extends AbstractOAuthClient

  Helper code to obtain oauth access tokens via browser redirects
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected javax.ws.rs.client.Client` | `client`
    `protected static org.jboss.logging.Logger` | `logger`

    - ### Fields inherited from class org.keycloak.AbstractOAuthClient

      `authUrl, clientId, codeUrl, credentials, isSecure, publicClient, refreshUrl, relativeUrls, scope, stateCookieName, stateCookiePath`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JaxrsOAuthClient()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkStateCookie(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders headers)`
    `String` | `getAccessCode(javax.ws.rs.core.UriInfo uriInfo)`
    `String` | `getBearerToken(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders headers)`
    `javax.ws.rs.client.Client` | `getClient()`
    `String` | `getError(javax.ws.rs.core.UriInfo uriInfo)`
    `String` | `getStateCookiePath(javax.ws.rs.core.UriInfo uriInfo)`
    `javax.ws.rs.core.Response` | `redirect(javax.ws.rs.core.UriInfo uriInfo, String redirectUri)`
    `String` | `resolveBearerToken(String redirectUri, String code)`
    `void` | `setClient(javax.ws.rs.client.Client client)`
    `void` | `stop()` closes client

    - ### Methods inherited from class org.keycloak.AbstractOAuthClient

      `getAuthUrl, getClientId, getCodeUrl, getCredentials, getRefreshUrl, getScope, getStateCode, getStateCookieName, getStateCookiePath, isPublicClient, isRelativeUrls, setAuthUrl, setClientId, setCodeUrl, setCredentials, setPublicClient, setRefreshUrl, setRelativeUrls, setScope, setStateCookieName, setStateCookiePath, stripOauthParametersFromRedirect`

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

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

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

    - #### client

          protected javax.ws.rs.client.Client client

  - ### Constructor Detail

    - #### JaxrsOAuthClient

          public JaxrsOAuthClient()

  - ### Method Detail

    - #### stop

          public void stop()

      closes client

    - #### getClient

          public javax.ws.rs.client.Client getClient()

    - #### setClient

          public void setClient(javax.ws.rs.client.Client client)

    - #### resolveBearerToken

          public String resolveBearerToken(String redirectUri,
                                  String code)

    - #### redirect

          public javax.ws.rs.core.Response redirect(javax.ws.rs.core.UriInfo uriInfo,
                                           String redirectUri)

    - #### getStateCookiePath

          public String getStateCookiePath(javax.ws.rs.core.UriInfo uriInfo)

    - #### getBearerToken

          public String getBearerToken(javax.ws.rs.core.UriInfo uriInfo,
                              javax.ws.rs.core.HttpHeaders headers)
                                throws javax.ws.rs.BadRequestException,
                                       javax.ws.rs.InternalServerErrorException

      Throws:
        `javax.ws.rs.BadRequestException`
        `javax.ws.rs.InternalServerErrorException`

    - #### getError

          public String getError(javax.ws.rs.core.UriInfo uriInfo)

    - #### getAccessCode

          public String getAccessCode(javax.ws.rs.core.UriInfo uriInfo)

    - #### checkStateCookie

          public void checkStateCookie(javax.ws.rs.core.UriInfo uriInfo,
                              javax.ws.rs.core.HttpHeaders headers)

Copyright © 2014. All Rights Reserved.