org.jboss.resteasy.skeleton.key.as7

## Class ServletOAuthLogin

- java.lang.Object
- - org.jboss.resteasy.skeleton.key.as7.ServletOAuthLogin

-     public class ServletOAuthLogin
      extends Object

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `codePresent`
    `protected static AtomicLong` | `counter`
    `protected RealmConfiguration` | `realmInfo`
    `protected int` | `redirectPort`
    `protected javax.servlet.http.HttpServletRequest` | `request`
    `protected javax.servlet.http.HttpServletResponse` | `response`
    `protected SkeletonKeyToken` | `token`
    `protected String` | `tokenString`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServletOAuthLogin(RealmConfiguration realmInfo, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, int redirectPort)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `checkStateCookie()`
    `String` | `getCode()`
    `protected javax.servlet.http.Cookie` | `getCookie(String cookieName)`
    `protected String` | `getCookieValue(String cookieName)`
    `protected String` | `getDefaultCookiePath()`
    `String` | `getError()`
    `protected String` | `getQueryParamValue(String paramName)`
    `RealmConfiguration` | `getRealmInfo()`
    `protected String` | `getRedirectUri(String state)`
    `protected String` | `getRequestUrl()`
    `protected String` | `getStateCode()`
    `SkeletonKeyToken` | `getToken()`
    `String` | `getTokenString()`
    `protected boolean` | `isRequestSecure()`
    `void` | `loginRedirect()`
    `boolean` | `resolveCode(String code)` Start or continue the oauth login process.
    `protected void` | `sendError(int code)`
    `protected void` | `sendRedirect(String url)`
    `protected void` | `setCookie(String name, String value, String domain, String path, boolean secure)`
    `protected String` | `stripOauthParametersFromRedirect()` strip out unwanted query parameters and redirect so bookmarks don't retain oauth protocol bits

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

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

- - ### Field Detail

    - #### request

          protected javax.servlet.http.HttpServletRequest request

    - #### response

          protected javax.servlet.http.HttpServletResponse response

    - #### codePresent

          protected boolean codePresent

    - #### realmInfo

          protected RealmConfiguration realmInfo

    - #### redirectPort

          protected int redirectPort

    - #### tokenString

          protected String tokenString

    - #### token

          protected SkeletonKeyToken token

    - #### counter

          protected static final AtomicLong counter

  - ### Constructor Detail

    - #### ServletOAuthLogin

          public ServletOAuthLogin(RealmConfiguration realmInfo,
                           javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response,
                           int redirectPort)

  - ### Method Detail

    - #### getTokenString

          public String getTokenString()

    - #### getToken

          public SkeletonKeyToken getToken()

    - #### getRealmInfo

          public RealmConfiguration getRealmInfo()

    - #### getDefaultCookiePath

          protected String getDefaultCookiePath()

    - #### getRequestUrl

          protected String getRequestUrl()

    - #### isRequestSecure

          protected boolean isRequestSecure()

    - #### sendError

          protected void sendError(int code)

    - #### sendRedirect

          protected void sendRedirect(String url)

    - #### getCookie

          protected javax.servlet.http.Cookie getCookie(String cookieName)

    - #### getCookieValue

          protected String getCookieValue(String cookieName)

    - #### getQueryParamValue

          protected String getQueryParamValue(String paramName)

    - #### getError

          public String getError()

    - #### getCode

          public String getCode()

    - #### setCookie

          protected void setCookie(String name,
                       String value,
                       String domain,
                       String path,
                       boolean secure)

    - #### getRedirectUri

          protected String getRedirectUri(String state)

    - #### getStateCode

          protected String getStateCode()

    - #### loginRedirect

          public void loginRedirect()

    - #### checkStateCookie

          public boolean checkStateCookie()

    - #### resolveCode

          public boolean resolveCode(String code)

      Start or continue the oauth login process. if code query parameter is not present, then browser is redirected to authUrl. The redirect URL will be the URL of the current request. If code query parameter is present, then an access token is obtained by invoking a secure request to the codeUrl. If the access token is obtained, the browser is again redirected to the current request URL, but any OAuth protocol specific query parameters are removed.
      Returns:
        true if an access token was obtained

    - #### stripOauthParametersFromRedirect

          protected String stripOauthParametersFromRedirect()

      strip out unwanted query parameters and redirect so bookmarks don't retain oauth protocol bits

Copyright © 2014. All Rights Reserved.