public class GTAuthorizationCode
extends java.lang.Object
GTAuthorizationCode
supports authorization code grant type flow
Authorization Code GrantModifier and Type | Class and Description |
---|---|
static class |
GTAuthorizationCode.Authorization
This class contains data returned by an authorization server when a user grants access to data.
|
Modifier and Type | Method and Description |
---|---|
static AccessTokenRequest |
createAccessTokenRequest(OAuth2 data,
java.lang.String code,
java.lang.String redirect_uri)
creates an 'access token request'.
|
static Request |
createAuthorizationRequest(OAuth2 data,
java.lang.String redirect_uri,
java.lang.String scope,
java.lang.String state)
Creates an authorization request as required by the specification.
|
static GTAuthorizationCode.Authorization |
getAuthorization(IResponse response)
Extracts authorization data from an authorization server's response.
|
public static Request createAuthorizationRequest(OAuth2 data, java.lang.String redirect_uri, java.lang.String scope, java.lang.String state)
A successful response to this request should have result code 302 and 'Location' field with an uri that the user should visit to grant requested permissions.
The parameters redirect_uri
, scope
and state
may be
null
.
data
- a reference to the OAuth2 object instance that contains
information about authorization processredirect_uri
- redirection endpointscope
- The scope of the access requeststate
- An opaque value used by the client to maintain state
between the request and callbackpublic static GTAuthorizationCode.Authorization getAuthorization(IResponse response) throws OAuth2Exception, java.io.IOException
Our implementation can't control the "state" parameter presence in the response. Application should control it by itself.
response
- a response from an authorization serverOAuth2Exception
- if an OAuth specific error occursjava.io.IOException
- if an I/O error occurspublic static AccessTokenRequest createAccessTokenRequest(OAuth2 data, java.lang.String code, java.lang.String redirect_uri)
data
- a reference to the OAuth2 object instance that contains
information about authorization processcode
- The authorization code generated by the authorization serverredirect_uri
- redirection URI. May be null
.Copyright © 2013, 2014, Oracle and/or its affiliates. All rights reserved.