Working on request object userinfo parsing
parent
779001a8c8
commit
67e8714671
|
@ -64,7 +64,7 @@ public class OIDCSignedRequestFilter extends AbstractOIDCAuthenticationFilter im
|
|||
"An Authorization Endpoint URI must be supplied");
|
||||
|
||||
Assert.notNull(oidcServerConfig.getTokenEndpointUrl(),
|
||||
"A Token ID Endpoint URI must be supplied");
|
||||
"A Token Endpoint URI must be supplied");
|
||||
|
||||
Assert.notNull(oidcServerConfig.getClientId(),
|
||||
"A Client ID must be supplied");
|
||||
|
|
|
@ -75,7 +75,18 @@ public class JSONUserInfoView extends AbstractView {
|
|||
try {
|
||||
|
||||
out = response.getWriter();
|
||||
gson.toJson(toJson(userInfo, scope), out);
|
||||
|
||||
if (model.get("requestObject") != null) {
|
||||
String jsonString = (String)model.get("requestObject");
|
||||
JsonObject requestObject = gson.fromJson(jsonString, JsonObject.class);
|
||||
|
||||
gson.toJson(toJsonFromRequestObj(userInfo, scope, requestObject));
|
||||
|
||||
} else {
|
||||
|
||||
gson.toJson(toJson(userInfo, scope), out);
|
||||
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
|
||||
|
@ -135,4 +146,15 @@ public class JSONUserInfoView extends AbstractView {
|
|||
|
||||
return obj;
|
||||
}
|
||||
|
||||
private JsonObject toJsonFromRequestObj(UserInfo ui, Set<String> scope, JsonObject requestObj) {
|
||||
|
||||
JsonObject obj = new JsonObject();
|
||||
|
||||
|
||||
|
||||
|
||||
return obj;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,9 +105,9 @@ public class RequestObjectAuthorizationEndpoint {
|
|||
|
||||
String requestUri = claims.getClaimAsString("request_uri");
|
||||
if (requestUri != null) {
|
||||
if (parameters.containsKey("request_uri") == false) {
|
||||
parameters.put("request_uri", requestUri);
|
||||
}
|
||||
//The spec does not allow a client to send a request parameter AND
|
||||
//link to a hosted request object at the same time, so this is an error.
|
||||
//TODO: what error to throw?
|
||||
}
|
||||
|
||||
// call out to the SECOAUTH endpoint to do the real processing
|
||||
|
|
|
@ -88,6 +88,7 @@ public class UserInfoEndpoint {
|
|||
OAuth2Authentication authentication = (OAuth2Authentication)p;
|
||||
|
||||
model.addAttribute("scope", authentication.getAuthorizationRequest().getScope());
|
||||
model.addAttribute("requestObject", authentication.getAuthorizationRequest().getAuthorizationParameters().get("request"));
|
||||
}
|
||||
|
||||
model.addAttribute("userInfo", userInfo);
|
||||
|
|
Loading…
Reference in New Issue