use of org.xdi.oxauth.client.model.authorize.Claim in project oxAuth by GluuFederation.
the class AuthorizationAction method getOpenIdRequestObject.
public String getOpenIdRequestObject() {
openIdRequestObject = "";
try {
if (useOpenIdRequestObject) {
AuthorizationRequest req = new AuthorizationRequest(responseTypes, clientId, scopes, redirectUri, nonce);
req.setState(state);
req.setRequestUri(requestUri);
req.setMaxAge(maxAge);
req.setUiLocales(StringUtils.spaceSeparatedToList(uiLocales));
req.setClaimsLocales(StringUtils.spaceSeparatedToList(claimsLocales));
req.setIdTokenHint(idTokenHint);
req.setLoginHint(loginHint);
req.setAcrValues(StringUtils.spaceSeparatedToList(acrValues));
req.setRegistration(registration);
req.setDisplay(display);
req.getPrompts().addAll(prompt);
OxAuthCryptoProvider cryptoProvider = new OxAuthCryptoProvider();
JwtAuthorizationRequest jwtAuthorizationRequest = new JwtAuthorizationRequest(req, SignatureAlgorithm.NONE, (String) null, cryptoProvider);
jwtAuthorizationRequest.addUserInfoClaim(new Claim(JwtClaimName.NAME, ClaimValue.createNull()));
jwtAuthorizationRequest.addUserInfoClaim(new Claim(JwtClaimName.NICKNAME, ClaimValue.createEssential(false)));
jwtAuthorizationRequest.addUserInfoClaim(new Claim(JwtClaimName.EMAIL, ClaimValue.createNull()));
jwtAuthorizationRequest.addUserInfoClaim(new Claim(JwtClaimName.EMAIL_VERIFIED, ClaimValue.createNull()));
jwtAuthorizationRequest.addUserInfoClaim(new Claim(JwtClaimName.PICTURE, ClaimValue.createEssential(false)));
jwtAuthorizationRequest.addIdTokenClaim(new Claim(JwtClaimName.AUTHENTICATION_TIME, ClaimValue.createNull()));
jwtAuthorizationRequest.addIdTokenClaim(new Claim(JwtClaimName.AUTHENTICATION_CONTEXT_CLASS_REFERENCE, ClaimValue.createValueList(new String[] { "2" })));
jwtAuthorizationRequest.getIdTokenMember().setMaxAge(86400);
openIdRequestObject = jwtAuthorizationRequest.getDecodedJwt();
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return openIdRequestObject;
}
Aggregations