Search in sources :

Example 1 with DynamicClientRegistrationContext

use of org.gluu.oxauth.service.external.context.DynamicClientRegistrationContext 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;
    }
}
Also used : JSONObject(org.json.JSONObject) ClientRegistrationType(org.gluu.model.custom.script.type.client.ClientRegistrationType) DynamicClientRegistrationContext(org.gluu.oxauth.service.external.context.DynamicClientRegistrationContext)

Example 2 with DynamicClientRegistrationContext

use of org.gluu.oxauth.service.external.context.DynamicClientRegistrationContext 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 "";
    }
}
Also used : ClientRegistrationType(org.gluu.model.custom.script.type.client.ClientRegistrationType) DynamicClientRegistrationContext(org.gluu.oxauth.service.external.context.DynamicClientRegistrationContext)

Aggregations

ClientRegistrationType (org.gluu.model.custom.script.type.client.ClientRegistrationType)2 DynamicClientRegistrationContext (org.gluu.oxauth.service.external.context.DynamicClientRegistrationContext)2 JSONObject (org.json.JSONObject)1