use of org.gluu.model.custom.script.type.client.ClientRegistrationType in project oxAuth by GluuFederation.
the class ExternalDynamicClientRegistrationService method executeExternalCreateClientMethod.
public boolean executeExternalCreateClientMethod(CustomScriptConfiguration customScriptConfiguration, RegisterRequest registerRequest, Client client) {
try {
log.trace("Executing python 'createClient' method");
ClientRegistrationType externalClientRegistrationType = (ClientRegistrationType) customScriptConfiguration.getExternalType();
Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
return externalClientRegistrationType.createClient(registerRequest, client, configurationAttributes);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
saveScriptError(customScriptConfiguration.getCustomScript(), ex);
}
return false;
}
use of org.gluu.model.custom.script.type.client.ClientRegistrationType in project oxAuth by GluuFederation.
the class ExternalDynamicClientRegistrationService method executeExternalUpdateClientMethod.
public boolean executeExternalUpdateClientMethod(CustomScriptConfiguration customScriptConfiguration, RegisterRequest registerRequest, Client client) {
try {
log.trace("Executing python 'updateClient' method");
ClientRegistrationType externalClientRegistrationType = (ClientRegistrationType) customScriptConfiguration.getExternalType();
Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
return externalClientRegistrationType.updateClient(registerRequest, client, configurationAttributes);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
saveScriptError(customScriptConfiguration.getCustomScript(), ex);
}
return false;
}
use of org.gluu.model.custom.script.type.client.ClientRegistrationType in project oxAuth by GluuFederation.
the class ExternalDynamicClientRegistrationService method getSoftwareStatementJwks.
public JSONObject getSoftwareStatementJwks(HttpServletRequest httpRequest, JSONObject registerRequest, Jwt softwareStatement) {
try {
log.trace("Executing python 'getSoftwareStatementJwks' method");
DynamicClientRegistrationContext context = new DynamicClientRegistrationContext(httpRequest, registerRequest, defaultExternalCustomScript);
context.setSoftwareStatement(softwareStatement);
ClientRegistrationType externalType = (ClientRegistrationType) defaultExternalCustomScript.getExternalType();
final String result = externalType.getSoftwareStatementJwks(context);
log.trace("Result of python 'getSoftwareStatementJwks' method: " + result);
return new JSONObject(result);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
saveScriptError(defaultExternalCustomScript.getCustomScript(), ex);
return null;
}
}
use of org.gluu.model.custom.script.type.client.ClientRegistrationType in project oxAuth by GluuFederation.
the class ExternalDynamicClientRegistrationService method getSoftwareStatementHmacSecret.
public String getSoftwareStatementHmacSecret(HttpServletRequest httpRequest, JSONObject registerRequest, Jwt softwareStatement) {
try {
log.trace("Executing python 'getSoftwareStatementHmacSecret' method");
DynamicClientRegistrationContext context = new DynamicClientRegistrationContext(httpRequest, registerRequest, defaultExternalCustomScript);
context.setSoftwareStatement(softwareStatement);
ClientRegistrationType externalType = (ClientRegistrationType) defaultExternalCustomScript.getExternalType();
final String result = externalType.getSoftwareStatementHmacSecret(context);
log.trace("Result of python 'getSoftwareStatementHmacSecret' method: " + result);
return result;
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
saveScriptError(defaultExternalCustomScript.getCustomScript(), ex);
return "";
}
}
Aggregations