MultivaluedMap<String, String> params,
UserSubject subject,
String redirectUri,
List<OAuthPermission> perms) {
OAuthAuthorizationData secData = new OAuthAuthorizationData();
addAuthenticityTokenToSession(secData, params, subject);
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));
secData.setApplicationCertificates(client.getApplicationCertificates());
Map<String, String> extraProperties = client.getProperties();
secData.setExtraApplicationProperties(extraProperties);
String replyTo = getMessageContext().getUriInfo()
.getAbsolutePathBuilder().path("decision").build().toString();
secData.setReplyTo(replyTo);
return secData;
}