* Create the authorization challenge data
*/
protected OAuthAuthorizationData createAuthorizationData(
Client client, MultivaluedMap<String, String> params, String redirectUri, List<OAuthPermission> perms) {
OAuthAuthorizationData secData = new OAuthAuthorizationData();
addAuthenticityTokenToSession(secData);
secData.setPermissions(perms);
secData.setProposedScope(OAuthUtils.convertPermissionsToScope(perms));
secData.setClientId(client.getClientId());
if (redirectUri != null) {
secData.setRedirectUri(redirectUri);
}
secData.setState(params.getFirst(OAuthConstants.STATE));
secData.setApplicationName(client.getApplicationName());
secData.setApplicationWebUri(client.getApplicationWebUri());
secData.setApplicationDescription(client.getApplicationDescription());
secData.setApplicationLogoUri(client.getApplicationLogoUri());
secData.setAudience(params.getFirst(OAuthConstants.CLIENT_AUDIENCE));
List<Property> extraProperties = client.getProperties();
secData.setExtraApplicationProperties(extraProperties == null ? Collections.<Property>emptyList()
: Collections.unmodifiableList(extraProperties));
String replyTo = getMessageContext().getUriInfo()
.getAbsolutePathBuilder().path("decision").build().toString();
secData.setReplyTo(replyTo);
return secData;
}