gluu
公開メンバ関数 | 静的非公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.xdi.oxauth.uma.ws.rs.UmaGatheringWS クラス
org.xdi.oxauth.uma.ws.rs.UmaGatheringWS 連携図
Collaboration graph

公開メンバ関数

Response gatherClaims (String clientId, String ticket, String claimRedirectUri, String state, Boolean reset, Boolean authenticationRedirect, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
 
Response getGatherClaims ( @QueryParam("client_id") String clientId, @QueryParam("ticket") String ticket, @QueryParam("claims_redirect_uri") String claimRedirectUri, @QueryParam("state") String state, @QueryParam("reset") Boolean reset, @QueryParam("authentication") Boolean authenticationRedirect, @Context HttpServletRequest httpRequest, @Context HttpServletResponse httpResponse)
 
Response postGatherClaims ( @FormParam("client_id") String clientId, @FormParam("ticket") String ticket, @FormParam("claims_redirect_uri") String claimRedirectUri, @FormParam("state") String state, @FormParam("reset") Boolean reset, @FormParam("authentication") Boolean authenticationRedirect, @Context HttpServletRequest httpRequest, @Context HttpServletResponse httpResponse)
 

静的非公開メンバ関数

static String getScriptNames (List< UmaPermission > permissions)
 

非公開変数類

Logger log
 
ErrorResponseFactory errorResponseFactory
 
UmaValidationService validationService
 
ExternalUmaClaimsGatheringService external
 
UmaSessionService sessionService
 
UmaPermissionService permissionService
 
UmaPctService pctService
 
AppConfiguration appConfiguration
 
UserService userService
 

詳解

Claims-Gathering Endpoint.

著者
yuriyz
バージョン
August 9, 2017

関数詳解

◆ gatherClaims()

Response org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.gatherClaims ( String  clientId,
String  ticket,
String  claimRedirectUri,
String  state,
Boolean  reset,
Boolean  authenticationRedirect,
HttpServletRequest  httpRequest,
HttpServletResponse  httpResponse 
)
inline
80  {
81  try {
82  log.trace("gatherClaims client_id: {}, ticket: {}, claims_redirect_uri: {}, state: {}, authenticationRedirect: {}, queryString: {}",
83  clientId, ticket, claimRedirectUri, state, authenticationRedirect, httpRequest.getQueryString());
84 
85  SessionId session = sessionService.getSession(httpRequest, httpResponse);
86 
87  if (authenticationRedirect != null && authenticationRedirect) { // restore parameters from session
88  log.debug("Authentication redirect, restoring parameters from session ...");
89  if (session == null) {
90  log.error("Session is null however authentication=true. Wrong workflow! Please correct custom Glaims-Gathering Script.");
91  throw new UmaWebException(BAD_REQUEST, errorResponseFactory, INVALID_SESSION);
92  }
93  clientId = sessionService.getClientId(session);
94  ticket = sessionService.getTicket(session);
95  claimRedirectUri = sessionService.getClaimsRedirectUri(session);
96  state = sessionService.getState(session);
97  log.debug("Restored parameters from session, clientId: {}, ticket: {}, claims_redirect_uri: {}, state: {}",
98  clientId, ticket, claimRedirectUri, state);
99  }
100 
101  validationService.validateClientAndClaimsRedirectUri(clientId, claimRedirectUri, state);
102  List<UmaPermission> permissions = validationService.validateTicketWithRedirect(ticket, claimRedirectUri, state);
103  String[] scriptNames = validationService.validatesGatheringScriptNames(getScriptNames(permissions), claimRedirectUri, state);
104 
105  CustomScriptConfiguration script = external.determineScript(scriptNames);
106  if (script == null) {
107  log.error("Failed to determine claims-gathering script for names: " + Arrays.toString(scriptNames));
108  throw new UmaWebException(claimRedirectUri, errorResponseFactory, INVALID_CLAIMS_GATHERING_SCRIPT_NAME, state);
109  }
110 
111  sessionService.configure(session, script.getName(), reset, permissions, clientId, claimRedirectUri, state);
112 
113  UmaGatherContext context = new UmaGatherContext(script.getConfigurationAttributes(), httpRequest, session, sessionService, permissionService,
114  pctService, new HashMap<String, String>(), userService, null, appConfiguration);
115 
116  int step = sessionService.getStep(session);
117  int stepsCount = external.getStepsCount(script, context);
118 
119  if (step < stepsCount) {
120  String page = external.getPageForStep(script, step, context);
121 
122  context.persist();
123 
124  String baseEndpoint = StringUtils.removeEnd(appConfiguration.getBaseEndpoint(), "/");
125  baseEndpoint = StringUtils.removeEnd(baseEndpoint, "restv1");
126  baseEndpoint = StringUtils.removeEnd(baseEndpoint, "/");
127 
128  String fullUri = baseEndpoint + page;
129  fullUri = StringUtils.removeEnd(fullUri, ".xhtml") + ".htm";
130  log.trace("Redirecting to page: '{}', fullUri: {}", page, fullUri);
131  return Response.status(FOUND).location(new URI(fullUri)).build();
132  } else {
133  log.error("Step '{}' is more or equal to stepCount: '{}'", stepsCount);
134  }
135  } catch (Exception ex) {
136  log.error("Exception happened", ex);
137  if (ex instanceof WebApplicationException) {
138  throw (WebApplicationException) ex;
139  }
140  }
141 
142  log.error("Failed to handle call to UMA Claims Gathering Endpoint.");
143  throw new UmaWebException(Response.Status.INTERNAL_SERVER_ERROR, errorResponseFactory, UmaErrorResponseType.SERVER_ERROR);
144  }
String getClaimsRedirectUri(SessionId session)
Definition: UmaSessionService.java:182
List< UmaPermission > validateTicketWithRedirect(String ticket, String claimsRedirectUri, String state)
Definition: UmaValidationService.java:251
int getStep(SessionId session)
Definition: UmaSessionService.java:90
AppConfiguration appConfiguration
Definition: UmaGatheringWS.java:75
CustomScriptConfiguration determineScript(String[] scriptNames)
Definition: ExternalUmaClaimsGatheringService.java:52
String getState(SessionId session)
Definition: UmaSessionService.java:190
UserService userService
Definition: UmaGatheringWS.java:77
UmaPermissionService permissionService
Definition: UmaGatheringWS.java:71
String getTicket(SessionId session)
Definition: UmaSessionService.java:198
String [] validatesGatheringScriptNames(String scriptNamesAsString, String claimsRedirectUri, String state)
Definition: UmaValidationService.java:469
int getStepsCount(CustomScriptConfiguration script, UmaGatherContext context)
Definition: ExternalUmaClaimsGatheringService.java:147
Logger log
Definition: UmaGatheringWS.java:61
static String getScriptNames(List< UmaPermission > permissions)
Definition: UmaGatheringWS.java:146
String getBaseEndpoint()
Definition: AppConfiguration.java:328
String getClientId(SessionId session)
Definition: UmaSessionService.java:174
String getPageForStep(CustomScriptConfiguration script, int step, UmaGatherContext context)
Definition: ExternalUmaClaimsGatheringService.java:160
ErrorResponseFactory errorResponseFactory
Definition: UmaGatheringWS.java:63
UmaValidationService validationService
Definition: UmaGatheringWS.java:65
ExternalUmaClaimsGatheringService external
Definition: UmaGatheringWS.java:67
void configure(SessionId session, String scriptName, Boolean reset, List< UmaPermission > permissions, String clientId, String claimRedirectUri, String state)
Definition: UmaSessionService.java:104
Client validateClientAndClaimsRedirectUri(String clientId, String claimsRedirectUri, String state)
Definition: UmaValidationService.java:409
UmaSessionService sessionService
Definition: UmaGatheringWS.java:69
SessionId getSession(HttpServletRequest httpRequest, HttpServletResponse httpResponse)
Definition: UmaSessionService.java:54
UmaPctService pctService
Definition: UmaGatheringWS.java:73

◆ getGatherClaims()

Response org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.getGatherClaims ( @QueryParam("client_id") String  clientId,
@QueryParam("ticket") String  ticket,
@QueryParam("claims_redirect_uri") String  claimRedirectUri,
@QueryParam("state") String  state,
@QueryParam("reset") Boolean  reset,
@QueryParam("authentication") Boolean  authenticationRedirect,
@Context HttpServletRequest  httpRequest,
@Context HttpServletResponse  httpResponse 
)
inline
166  {
167  return gatherClaims(clientId, ticket, claimRedirectUri, state, reset, authenticationRedirect, httpRequest, httpResponse);
168  }
Response gatherClaims(String clientId, String ticket, String claimRedirectUri, String state, Boolean reset, Boolean authenticationRedirect, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
Definition: UmaGatheringWS.java:79

◆ getScriptNames()

static String org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.getScriptNames ( List< UmaPermission permissions)
inlinestaticprivate
146  {
147  return permissions.get(0).getAttributes().get(UmaConstants.GATHERING_ID);
148  }

◆ postGatherClaims()

Response org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.postGatherClaims ( @FormParam("client_id") String  clientId,
@FormParam("ticket") String  ticket,
@FormParam("claims_redirect_uri") String  claimRedirectUri,
@FormParam("state") String  state,
@FormParam("reset") Boolean  reset,
@FormParam("authentication") Boolean  authenticationRedirect,
@Context HttpServletRequest  httpRequest,
@Context HttpServletResponse  httpResponse 
)
inline
187  {
188  return gatherClaims(clientId, ticket, claimRedirectUri, state, reset, authenticationRedirect, httpRequest, httpResponse);
189  }
Response gatherClaims(String clientId, String ticket, String claimRedirectUri, String state, Boolean reset, Boolean authenticationRedirect, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
Definition: UmaGatheringWS.java:79

メンバ詳解

◆ appConfiguration

AppConfiguration org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.appConfiguration
private

◆ errorResponseFactory

ErrorResponseFactory org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.errorResponseFactory
private

◆ external

ExternalUmaClaimsGatheringService org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.external
private

◆ log

Logger org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.log
private

◆ pctService

UmaPctService org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.pctService
private

◆ permissionService

UmaPermissionService org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.permissionService
private

◆ sessionService

UmaSessionService org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.sessionService
private

◆ userService

UserService org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.userService
private

◆ validationService

UmaValidationService org.xdi.oxauth.uma.ws.rs.UmaGatheringWS.validationService
private

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