gluu
公開メンバ関数 | 限定公開変数類 | 非公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.xdi.oxauth.client.AuthorizationResponse クラス
org.xdi.oxauth.client.AuthorizationResponse の継承関係図
Inheritance graph
org.xdi.oxauth.client.AuthorizationResponse 連携図
Collaboration graph

公開メンバ関数

 AuthorizationResponse (ClientResponse< String > clientResponse)
 
 AuthorizationResponse (String location)
 
String getCode ()
 
void setCode (String code)
 
String getAccessToken ()
 
void setAccessToken (String accessToken)
 
String getSessionId ()
 
void setSessionId (String p_sessionId)
 
Map< String, String > getCustomParams ()
 
void setCustomParams (Map< String, String > customParams)
 
ResponseMode getResponseMode ()
 
void setResponseMode (ResponseMode responseMode)
 
TokenType getTokenType ()
 
void setTokenType (TokenType tokenType)
 
Integer getExpiresIn ()
 
void setExpiresIn (Integer expiresIn)
 
String getScope ()
 
void setScope (String scope)
 
String getIdToken ()
 
void setIdToken (String idToken)
 
String getState ()
 
void setState (String state)
 
AuthorizeErrorResponseType getErrorType ()
 
void setErrorType (AuthorizeErrorResponseType errorType)
 
String getErrorDescription ()
 
void setErrorDescription (String errorDescription)
 
String getErrorUri ()
 
void setErrorUri (String errorUri)
 
int getStatus ()
 
String getLocation ()
 
void setLocation (String location)
 
void setStatus (int status)
 
String getEntity ()
 
void setEntity (String entity)
 
MultivaluedMap< String, Object > getHeaders ()
 
void setHeaders (MultivaluedMap< String, Object > headers)
 

限定公開変数類

int status
 
String location
 
String entity
 
MultivaluedMap< String, Object > headers
 

非公開メンバ関数

void processLocation ()
 

非公開変数類

String code
 
String accessToken
 
TokenType tokenType
 
Integer expiresIn
 
String scope
 
String idToken
 
String state
 
String sessionId
 
Map< String, String > customParams
 
ResponseMode responseMode
 
AuthorizeErrorResponseType errorType
 
String errorDescription
 
String errorUri
 

詳解

Represents an authorization response received from the authorization server.

著者
Javier Rojas Blum
バージョン
August 9, 2017

構築子と解体子

◆ AuthorizationResponse() [1/2]

org.xdi.oxauth.client.AuthorizationResponse.AuthorizationResponse ( ClientResponse< String >  clientResponse)
inline

Constructs an authorization response.

52  {
53  super(clientResponse);
54  customParams = new HashMap<String, String>();
55 
56  if (StringUtils.isNotBlank(entity)) {
57  try {
58  JSONObject jsonObj = new JSONObject(entity);
59  if (jsonObj.has("error")) {
60  errorType = AuthorizeErrorResponseType.fromString(jsonObj.getString("error"));
61  }
62  if (jsonObj.has("error_description")) {
63  errorDescription = jsonObj.getString("error_description");
64  }
65  if (jsonObj.has("error_uri")) {
66  errorUri = jsonObj.getString("error_uri");
67  }
68  if (jsonObj.has("state")) {
69  state = jsonObj.getString("state");
70  }
71  if (jsonObj.has("redirect")) {
72  location = jsonObj.getString("redirect");
73  }
74  } catch (JSONException e) {
75  e.printStackTrace();
76  }
77  }
79  }
static AuthorizeErrorResponseType fromString(String param)
Definition: AuthorizeErrorResponseType.java:133
String location
Definition: BaseResponse.java:20
String errorUri
Definition: AuthorizationResponse.java:47
Map< String, String > customParams
Definition: AuthorizationResponse.java:42
AuthorizeErrorResponseType errorType
Definition: AuthorizationResponse.java:45
String entity
Definition: BaseResponse.java:21
void processLocation()
Definition: AuthorizationResponse.java:88
String errorDescription
Definition: AuthorizationResponse.java:46
String state
Definition: AuthorizationResponse.java:40

◆ AuthorizationResponse() [2/2]

org.xdi.oxauth.client.AuthorizationResponse.AuthorizationResponse ( String  location)
inline
81  {
82  this.location = location;
83  customParams = new HashMap<String, String>();
84 
86  }
String location
Definition: BaseResponse.java:20
Map< String, String > customParams
Definition: AuthorizationResponse.java:42
void processLocation()
Definition: AuthorizationResponse.java:88

関数詳解

◆ getAccessToken()

String org.xdi.oxauth.client.AuthorizationResponse.getAccessToken ( )
inline

Returns the access token issued by the authorization server.

戻り値
The access token.
185  {
186  return accessToken;
187  }
String accessToken
Definition: AuthorizationResponse.java:35

◆ getCode()

String org.xdi.oxauth.client.AuthorizationResponse.getCode ( )
inline

Returns the authorization code generated by the authorization server.

戻り値
The authorization code.
167  {
168  return code;
169  }
String code
Definition: AuthorizationResponse.java:34

◆ getCustomParams()

Map<String, String> org.xdi.oxauth.client.AuthorizationResponse.getCustomParams ( )
inline
216  {
217  return customParams;
218  }
Map< String, String > customParams
Definition: AuthorizationResponse.java:42

◆ getEntity()

String org.xdi.oxauth.client.BaseResponse.getEntity ( )
inlineinherited

Returns the entity or body content of the response.

戻り値
The entity or body content of the response.
85  {
86  return entity;
87  }
String entity
Definition: BaseResponse.java:21

◆ getErrorDescription()

String org.xdi.oxauth.client.AuthorizationResponse.getErrorDescription ( )
inline

Returns a human-readable UTF-8 encoded text providing additional information, used to assist the client developer in understanding the error that occurred.

戻り値
The error description.
355  {
356  return errorDescription;
357  }
String errorDescription
Definition: AuthorizationResponse.java:46

◆ getErrorType()

AuthorizeErrorResponseType org.xdi.oxauth.client.AuthorizationResponse.getErrorType ( )
inline

Returns the error code when the request fails, otherwise will return null.

戻り値
The error code when the request fails.
334  {
335  return errorType;
336  }
AuthorizeErrorResponseType errorType
Definition: AuthorizationResponse.java:45

◆ getErrorUri()

String org.xdi.oxauth.client.AuthorizationResponse.getErrorUri ( )
inline

Returns a URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.

戻り値
A URI with information about the error.
377  {
378  return errorUri;
379  }
String errorUri
Definition: AuthorizationResponse.java:47

◆ getExpiresIn()

Integer org.xdi.oxauth.client.AuthorizationResponse.getExpiresIn ( )
inline

Returns the lifetime in seconds of the access token. For example, the value 3600 denotes that the access token will expire in one hour from the time the response was generated.

戻り値
The lifetime in seconds of the access token.
257  {
258  return expiresIn;
259  }
Integer expiresIn
Definition: AuthorizationResponse.java:37

◆ getHeaders()

MultivaluedMap<String, Object> org.xdi.oxauth.client.BaseResponse.getHeaders ( )
inlineinherited
98  {
99  return headers;
100  }
MultivaluedMap< String, Object > headers
Definition: BaseResponse.java:22

◆ getIdToken()

String org.xdi.oxauth.client.AuthorizationResponse.getIdToken ( )
inline

Returns the ID Token of the for the authentication session.

戻り値
The ID Token.
295  {
296  return idToken;
297  }
String idToken
Definition: AuthorizationResponse.java:39

◆ getLocation()

String org.xdi.oxauth.client.BaseResponse.getLocation ( )
inlineinherited

Returns the location of the response in the header.

戻り値
The location of the response.
58  {
59  return location;
60  }
String location
Definition: BaseResponse.java:20

◆ getResponseMode()

ResponseMode org.xdi.oxauth.client.AuthorizationResponse.getResponseMode ( )
inline
224  {
225  return responseMode;
226  }
ResponseMode responseMode
Definition: AuthorizationResponse.java:43

◆ getScope()

String org.xdi.oxauth.client.AuthorizationResponse.getScope ( )
inline

Returns the scope of the access token.

戻り値
The scope of the access token.
277  {
278  return scope;
279  }
String scope
Definition: AuthorizationResponse.java:38

◆ getSessionId()

String org.xdi.oxauth.client.AuthorizationResponse.getSessionId ( )
inline

Gets session id.

戻り値
session id.
203  {
204  return sessionId;
205  }
String sessionId
Definition: AuthorizationResponse.java:41

◆ getState()

String org.xdi.oxauth.client.AuthorizationResponse.getState ( )
inline

Returns the state. If the state parameter was present in the client authorization request, the exact value received from the client.

戻り値
The state.
314  {
315  return state;
316  }
String state
Definition: AuthorizationResponse.java:40

◆ getStatus()

int org.xdi.oxauth.client.BaseResponse.getStatus ( )
inlineinherited

Returns the HTTP status code of the response.

戻り値
The HTTP status code.
49  {
50  return status;
51  }
int status
Definition: BaseResponse.java:19

◆ getTokenType()

TokenType org.xdi.oxauth.client.AuthorizationResponse.getTokenType ( )
inline

Returns the type of the token issued (value is case insensitive).

戻り値
The type of the token.
237  {
238  return tokenType;
239  }
TokenType tokenType
Definition: AuthorizationResponse.java:36

◆ processLocation()

void org.xdi.oxauth.client.AuthorizationResponse.processLocation ( )
inlineprivate
88  {
89  try {
90  if (StringUtils.isNotBlank(location)) {
91  Map<String, String> params = null;
92  int fragmentIndex = location.indexOf("#");
93  if (fragmentIndex != -1) {
94  responseMode = ResponseMode.FRAGMENT;
95  String fragment = location.substring(fragmentIndex + 1);
96  params = QueryStringDecoder.decode(fragment);
97  } else {
98  int queryStringIndex = location.indexOf("?");
99  if (queryStringIndex != -1) {
100  responseMode = ResponseMode.QUERY;
101  String queryString = location.substring(queryStringIndex + 1);
102  params = QueryStringDecoder.decode(queryString);
103  }
104  }
105 
106  if (params != null) {
107  if (params.containsKey(CODE)) {
108  code = params.get(CODE);
109  params.remove(CODE);
110  }
111  if (params.containsKey(SESSION_ID)) {
112  sessionId = params.get(SESSION_ID);
113  params.remove(SESSION_ID);
114  }
115  if (params.containsKey(ACCESS_TOKEN)) {
116  accessToken = params.get(ACCESS_TOKEN);
117  params.remove(ACCESS_TOKEN);
118  }
119  if (params.containsKey(TOKEN_TYPE)) {
120  tokenType = TokenType.fromString(params.get(TOKEN_TYPE));
121  params.remove(TOKEN_TYPE);
122  }
123  if (params.containsKey(EXPIRES_IN)) {
124  expiresIn = Integer.parseInt(params.get(EXPIRES_IN));
125  params.remove(EXPIRES_IN);
126  }
127  if (params.containsKey(SCOPE)) {
128  scope = URLDecoder.decode(params.get(SCOPE), Util.UTF8_STRING_ENCODING);
129  params.remove(SCOPE);
130  }
131  if (params.containsKey(ID_TOKEN)) {
132  idToken = params.get(ID_TOKEN);
133  params.remove(ID_TOKEN);
134  }
135  if (params.containsKey(STATE)) {
136  state = params.get(STATE);
137  params.remove(STATE);
138  }
139  if (params.containsKey("error")) {
140  errorType = AuthorizeErrorResponseType.fromString(params.get("error"));
141  params.remove("error");
142  }
143  if (params.containsKey("error_description")) {
144  errorDescription = URLDecoder.decode(params.get("error_description"), Util.UTF8_STRING_ENCODING);
145  params.remove("error_description");
146  }
147  if (params.containsKey("error_uri")) {
148  errorUri = URLDecoder.decode(params.get("error_uri"), Util.UTF8_STRING_ENCODING);
149  params.remove("error_uri");
150  }
151 
152  for (Iterator<String> it = params.keySet().iterator(); it.hasNext(); ) {
153  String key = it.next();
154  getCustomParams().put(key, params.get(key));
155  }
156  }
157  }
158  } catch (UnsupportedEncodingException e) {
159  }
160  }
static AuthorizeErrorResponseType fromString(String param)
Definition: AuthorizeErrorResponseType.java:133
String scope
Definition: AuthorizationResponse.java:38
QUERY
Definition: ResponseMode.java:22
ResponseMode responseMode
Definition: AuthorizationResponse.java:43
FRAGMENT
Definition: ResponseMode.java:27
String location
Definition: BaseResponse.java:20
String errorUri
Definition: AuthorizationResponse.java:47
String code
Definition: AuthorizationResponse.java:34
Map< String, String > getCustomParams()
Definition: AuthorizationResponse.java:216
AuthorizeErrorResponseType errorType
Definition: AuthorizationResponse.java:45
String sessionId
Definition: AuthorizationResponse.java:41
Integer expiresIn
Definition: AuthorizationResponse.java:37
String idToken
Definition: AuthorizationResponse.java:39
String accessToken
Definition: AuthorizationResponse.java:35
String errorDescription
Definition: AuthorizationResponse.java:46
TokenType tokenType
Definition: AuthorizationResponse.java:36
String state
Definition: AuthorizationResponse.java:40
static TokenType fromString(String param)
Definition: TokenType.java:40

◆ setAccessToken()

void org.xdi.oxauth.client.AuthorizationResponse.setAccessToken ( String  accessToken)
inline

Sets the access token issued by the authorization server.

引数
accessTokenThe access token.
194  {
195  this.accessToken = accessToken;
196  }
String accessToken
Definition: AuthorizationResponse.java:35

◆ setCode()

void org.xdi.oxauth.client.AuthorizationResponse.setCode ( String  code)
inline

Sets the authorization code generated by the authorization server.

引数
codeThe authorization code.
176  {
177  this.code = code;
178  }
String code
Definition: AuthorizationResponse.java:34

◆ setCustomParams()

void org.xdi.oxauth.client.AuthorizationResponse.setCustomParams ( Map< String, String >  customParams)
inline
220  {
221  this.customParams = customParams;
222  }
Map< String, String > customParams
Definition: AuthorizationResponse.java:42

◆ setEntity()

void org.xdi.oxauth.client.BaseResponse.setEntity ( String  entity)
inlineinherited

Sets the entity or body content of the response.

引数
entityThe entity or body content of the response.
94  {
95  this.entity = entity;
96  }
String entity
Definition: BaseResponse.java:21

◆ setErrorDescription()

void org.xdi.oxauth.client.AuthorizationResponse.setErrorDescription ( String  errorDescription)
inline

Sets a human-readable UTF-8 encoded text providing additional information, used to assist the client developer in understanding the error that occurred.

引数
errorDescriptionThe error description.
366  {
368  }
String errorDescription
Definition: AuthorizationResponse.java:46

◆ setErrorType()

void org.xdi.oxauth.client.AuthorizationResponse.setErrorType ( AuthorizeErrorResponseType  errorType)
inline

Sets the error code when the request fails, otherwise will return null.

引数
errorTypeThe error code when the request fails.
344  {
345  this.errorType = errorType;
346  }
AuthorizeErrorResponseType errorType
Definition: AuthorizationResponse.java:45

◆ setErrorUri()

void org.xdi.oxauth.client.AuthorizationResponse.setErrorUri ( String  errorUri)
inline

Sets a URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.

引数
errorUriA URI with information about the error.
388  {
389  this.errorUri = errorUri;
390  }
String errorUri
Definition: AuthorizationResponse.java:47

◆ setExpiresIn()

void org.xdi.oxauth.client.AuthorizationResponse.setExpiresIn ( Integer  expiresIn)
inline

Sets the lifetime in seconds of the access token. For example, the value 3600 denotes that the access token will expire in one hour from the time the response was generated.

引数
expiresInThe lifetime in seconds of the access token.
268  {
269  this.expiresIn = expiresIn;
270  }
Integer expiresIn
Definition: AuthorizationResponse.java:37

◆ setHeaders()

void org.xdi.oxauth.client.BaseResponse.setHeaders ( MultivaluedMap< String, Object >  headers)
inlineinherited
102  {
103  this.headers = headers;
104  }
MultivaluedMap< String, Object > headers
Definition: BaseResponse.java:22

◆ setIdToken()

void org.xdi.oxauth.client.AuthorizationResponse.setIdToken ( String  idToken)
inline

Sets the ID Token of the for the authentication session.

引数
idTokenThe ID Token.
304  {
305  this.idToken = idToken;
306  }
String idToken
Definition: AuthorizationResponse.java:39

◆ setLocation()

void org.xdi.oxauth.client.BaseResponse.setLocation ( String  location)
inlineinherited

Sets the location of the response in the header.

引数
locationThe location of the response.
67  {
68  this.location = location;
69  }
String location
Definition: BaseResponse.java:20

◆ setResponseMode()

void org.xdi.oxauth.client.AuthorizationResponse.setResponseMode ( ResponseMode  responseMode)
inline
228  {
229  this.responseMode = responseMode;
230  }
ResponseMode responseMode
Definition: AuthorizationResponse.java:43

◆ setScope()

void org.xdi.oxauth.client.AuthorizationResponse.setScope ( String  scope)
inline

Sets the scope of the access token.

引数
scopeThe scope of the access token.
286  {
287  this.scope = scope;
288  }
String scope
Definition: AuthorizationResponse.java:38

◆ setSessionId()

void org.xdi.oxauth.client.AuthorizationResponse.setSessionId ( String  p_sessionId)
inline

Sets session id.

引数
p_sessionIdsession id.
212  {
213  sessionId = p_sessionId;
214  }
String sessionId
Definition: AuthorizationResponse.java:41

◆ setState()

void org.xdi.oxauth.client.AuthorizationResponse.setState ( String  state)
inline

Sets the state. If the state parameter was present in the client authorization request, the exact value received from the client.

引数
stateThe state.
324  {
325  this.state = state;
326  }
String state
Definition: AuthorizationResponse.java:40

◆ setStatus()

void org.xdi.oxauth.client.BaseResponse.setStatus ( int  status)
inlineinherited

Sets the HTTP status code of the response.

引数
statusThe HTTP status code.
76  {
77  this.status = status;
78  }
int status
Definition: BaseResponse.java:19

◆ setTokenType()

void org.xdi.oxauth.client.AuthorizationResponse.setTokenType ( TokenType  tokenType)
inline

Sets the type of the token issued (value is case insensitive).

引数
tokenTypeThe type of the token.
246  {
247  this.tokenType = tokenType;
248  }
TokenType tokenType
Definition: AuthorizationResponse.java:36

メンバ詳解

◆ accessToken

String org.xdi.oxauth.client.AuthorizationResponse.accessToken
private

◆ code

String org.xdi.oxauth.client.AuthorizationResponse.code
private

◆ customParams

Map<String, String> org.xdi.oxauth.client.AuthorizationResponse.customParams
private

◆ entity

String org.xdi.oxauth.client.BaseResponse.entity
protectedinherited

◆ errorDescription

String org.xdi.oxauth.client.AuthorizationResponse.errorDescription
private

◆ errorType

AuthorizeErrorResponseType org.xdi.oxauth.client.AuthorizationResponse.errorType
private

◆ errorUri

String org.xdi.oxauth.client.AuthorizationResponse.errorUri
private

◆ expiresIn

Integer org.xdi.oxauth.client.AuthorizationResponse.expiresIn
private

◆ headers

MultivaluedMap<String, Object> org.xdi.oxauth.client.BaseResponse.headers
protectedinherited

◆ idToken

String org.xdi.oxauth.client.AuthorizationResponse.idToken
private

◆ location

String org.xdi.oxauth.client.BaseResponse.location
protectedinherited

◆ responseMode

ResponseMode org.xdi.oxauth.client.AuthorizationResponse.responseMode
private

◆ scope

String org.xdi.oxauth.client.AuthorizationResponse.scope
private

◆ sessionId

String org.xdi.oxauth.client.AuthorizationResponse.sessionId
private

◆ state

String org.xdi.oxauth.client.AuthorizationResponse.state
private

◆ status

int org.xdi.oxauth.client.BaseResponse.status
protectedinherited

◆ tokenType

TokenType org.xdi.oxauth.client.AuthorizationResponse.tokenType
private

このクラス詳解は次のファイルから抽出されました: