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

公開メンバ関数

Response requestClientInfoGet (String accessToken, String authorization, SecurityContext securityContext)
 
Response requestClientInfoPost (String accessToken, String authorization, SecurityContext securityContext)
 
Response requestClientInfo (String accessToken, String authorization, SecurityContext securityContext)
 
String getJSonResponse (Client client, Set< String > scopes)
 
Response requestClientInfoGet ( @QueryParam("access_token") String accessToken, @HeaderParam("Authorization") String authorization, @Context SecurityContext securityContext)
 
Response requestClientInfoPost ( @FormParam("access_token") String accessToken, @HeaderParam("Authorization") String authorization, @Context SecurityContext securityContext)
 

非公開変数類

Logger log
 
ErrorResponseFactory errorResponseFactory
 
AuthorizationGrantList authorizationGrantList
 
ScopeService scopeService
 
ClientService clientService
 
AttributeService attributeService
 

詳解

Provides interface for Client Info REST web services

著者
Javier Rojas Blum
バージョン
0.9 March 27, 2015

関数詳解

◆ getJSonResponse()

String org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebServiceImpl.getJSonResponse ( Client  client,
Set< String >  scopes 
)
inline

Builds a JSon String with the response parameters.

105  {
106  JSONObject jsonObj = new JSONObject();
107 
108  try {
109  for (String scopeName : scopes) {
110  Scope scope = scopeService.getScopeByDisplayName(scopeName);
111 
112  if (scope.getOxAuthClaims() != null) {
113  for (String claimDn : scope.getOxAuthClaims()) {
114  GluuAttribute attribute = attributeService.getAttributeByDn(claimDn);
115 
116  String attributeName = attribute.getName();
117  Object attributeValue = clientService.getAttribute(client, attribute.getName());
118 
119  jsonObj.put(attributeName, attributeValue);
120  }
121  }
122  }
123  } catch (JSONException e) {
124  log.error(e.getMessage(), e);
125  } catch (Exception e) {
126  log.error(e.getMessage(), e);
127  }
128 
129  return jsonObj.toString();
130  }
ScopeService scopeService
Definition: ClientInfoRestWebServiceImpl.java:51
GluuAttribute getAttributeByDn(String dn)
Definition: AttributeService.java:47
Object getAttribute(Client client, String clientAttribute)
Definition: ClientService.java:337
org.xdi.oxauth.model.common.Scope getScopeByDisplayName(String displayName)
Definition: ScopeService.java:119
ClientService clientService
Definition: ClientInfoRestWebServiceImpl.java:54
Logger log
Definition: ClientInfoRestWebServiceImpl.java:42
AttributeService attributeService
Definition: ClientInfoRestWebServiceImpl.java:57

◆ requestClientInfo()

Response org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebServiceImpl.requestClientInfo ( String  accessToken,
String  authorization,
SecurityContext  securityContext 
)
inline
69  {
70  if (authorization != null && !authorization.isEmpty() && authorization.startsWith("Bearer ")) {
71  accessToken = authorization.substring(7);
72  }
73  log.debug("Attempting to request Client Info, Access token = {}, Is Secure = {}",
74  new Object[] { accessToken, securityContext.isSecure() });
75  Response.ResponseBuilder builder = Response.ok();
76 
77  if (!ClientInfoParamsValidator.validateParams(accessToken)) {
78  builder = Response.status(400);
79  builder.entity(errorResponseFactory.getErrorAsJson(ClientInfoErrorResponseType.INVALID_REQUEST));
80  } else {
81  AuthorizationGrant authorizationGrant = authorizationGrantList.getAuthorizationGrantByAccessToken(accessToken);
82 
83  if (authorizationGrant == null) {
84  builder = Response.status(400);
85  builder.entity(errorResponseFactory.getErrorAsJson(ClientInfoErrorResponseType.INVALID_TOKEN));
86  } else {
87  CacheControl cacheControl = new CacheControl();
88  cacheControl.setPrivate(true);
89  cacheControl.setNoTransform(false);
90  cacheControl.setNoStore(true);
91  builder.cacheControl(cacheControl);
92  builder.header("Pragma", "no-cache");
93 
94  builder.entity(getJSonResponse(authorizationGrant.getClient(),
95  authorizationGrant.getScopes()));
96  }
97  }
98 
99  return builder.build();
100  }
String getErrorAsJson(IErrorType p_type)
Definition: ErrorResponseFactory.java:86
AuthorizationGrantList authorizationGrantList
Definition: ClientInfoRestWebServiceImpl.java:48
ErrorResponseFactory errorResponseFactory
Definition: ClientInfoRestWebServiceImpl.java:45
String getJSonResponse(Client client, Set< String > scopes)
Definition: ClientInfoRestWebServiceImpl.java:105
Logger log
Definition: ClientInfoRestWebServiceImpl.java:42
AuthorizationGrant getAuthorizationGrantByAccessToken(String accessToken)
Definition: AuthorizationGrantList.java:166

◆ requestClientInfoGet() [1/2]

Response org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebService.requestClientInfoGet ( @QueryParam("access_token") String  accessToken,
@HeaderParam("Authorization") String  authorization,
@Context SecurityContext  securityContext 
)
inherited

◆ requestClientInfoGet() [2/2]

Response org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebServiceImpl.requestClientInfoGet ( String  accessToken,
String  authorization,
SecurityContext  securityContext 
)
inline
60  {
61  return requestClientInfo(accessToken, authorization, securityContext);
62  }
Response requestClientInfo(String accessToken, String authorization, SecurityContext securityContext)
Definition: ClientInfoRestWebServiceImpl.java:69

◆ requestClientInfoPost() [1/2]

Response org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebService.requestClientInfoPost ( @FormParam("access_token") String  accessToken,
@HeaderParam("Authorization") String  authorization,
@Context SecurityContext  securityContext 
)
inherited

◆ requestClientInfoPost() [2/2]

Response org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebServiceImpl.requestClientInfoPost ( String  accessToken,
String  authorization,
SecurityContext  securityContext 
)
inline
65  {
66  return requestClientInfo(accessToken, authorization, securityContext);
67  }
Response requestClientInfo(String accessToken, String authorization, SecurityContext securityContext)
Definition: ClientInfoRestWebServiceImpl.java:69

メンバ詳解

◆ attributeService

AttributeService org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebServiceImpl.attributeService
private

◆ authorizationGrantList

AuthorizationGrantList org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebServiceImpl.authorizationGrantList
private

◆ clientService

ClientService org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebServiceImpl.clientService
private

◆ errorResponseFactory

ErrorResponseFactory org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebServiceImpl.errorResponseFactory
private

◆ log

Logger org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebServiceImpl.log
private

◆ scopeService

ScopeService org.xdi.oxauth.clientinfo.ws.rs.ClientInfoRestWebServiceImpl.scopeService
private

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