use of io.jans.ca.common.Command in project jans by JanssenProject.
the class RestResource method getObjectForJsonConversion.
private static <T extends IParams> Object getObjectForJsonConversion(CommandType commandType, String paramsAsString, Class<T> paramsClass, String authorization, String AuthorizationRpId) {
LOG.trace("Command: {}", paramsAsString);
T params = read(safeToJson(paramsAsString), paramsClass);
final RpServerConfiguration conf = ServerLauncher.getInjector().getInstance(ConfigurationService.class).get();
if (commandType.isAuthorizationRequired()) {
validateAuthorizationRpId(conf, AuthorizationRpId);
validateAccessToken(authorization, safeToRpId((HasRpIdParams) params, AuthorizationRpId));
}
Command command = new Command(commandType, params);
final IOpResponse response = ServerLauncher.getInjector().getInstance(Processor.class).process(command);
Object forJsonConversion = response;
if (response instanceof POJOResponse) {
forJsonConversion = ((POJOResponse) response).getNode();
}
return forJsonConversion;
}
use of io.jans.ca.common.Command in project jans by JanssenProject.
the class NotAllowedTest method registerSite.
public static RegisterSiteResponse registerSite(ClientInterface client) {
final RegisterSiteParams params = new RegisterSiteParams();
params.setOpHost("https://ce-dev.gluu.org");
params.setRedirectUris(Lists.newArrayList("https://192.168.200.58:5053"));
params.setScope(Lists.newArrayList("openid", "profile", "email", "address", "clientinfo", "mobile_phone", "phone", "uma_protection"));
params.setPostLogoutRedirectUris(Lists.newArrayList("https://192.168.200.58:5053"));
params.setClientFrontchannelLogoutUri("https://192.168.200.58:5053/logout");
params.setAcrValues(Lists.newArrayList("gplus", "basic", "duo", "u2f"));
params.setGrantTypes(Lists.newArrayList("authorization_code"));
final Command command = new Command(CommandType.REGISTER_SITE);
command.setParamsObject(params);
final RegisterSiteResponse resp = client.registerSite(params);
assertNotNull(resp);
assertTrue(!Strings.isNullOrEmpty(resp.getRpId()));
return resp;
}
Aggregations