Search in sources :

Example 1 with Claim

use of com.forgerock.openbanking.model.claim.Claim in project openbanking-aspsp by OpenBankingToolkit.

the class AuthorisationApiController method verifyRequestparameterClaims.

private void verifyRequestparameterClaims(SignedJWT requestParameters) throws OBErrorException {
    JSONObject claims = null;
    try {
        JWTClaimsSet claimSet = requestParameters.getJWTClaimsSet();
        claims = new JSONObject(claimSet.getJSONObjectClaim(OIDCConstants.OIDCClaim.CLAIMS));
    } catch (ParseException pe) {
        log.info("verifyRequestparameterClaims() Could not obtain the {} claim from the request parameter.", OIDCConstants.OIDCClaim.CLAIMS);
        throw new OBErrorException(OBRIErrorType.REQUEST_PARAMETER_JWT_INVALID, "No claims obtainable from the " + "jwt");
    }
    if (!claims.containsKey(OpenBankingConstants.RequestParameterClaim.ID_TOKEN)) {
        throw new OBErrorException(OBRIErrorType.REQUEST_PARAMETER_JWT_INVALID, "No id token claims");
    }
    Map<String, Claim> idTokenClaims = validateIdToken(claims);
    validateUserInfo(claims, idTokenClaims);
}
Also used : JSONObject(com.nimbusds.jose.shaded.json.JSONObject) JWTClaimsSet(com.nimbusds.jwt.JWTClaimsSet) OBErrorException(com.forgerock.openbanking.exceptions.OBErrorException) ParseException(java.text.ParseException) Claim(com.forgerock.openbanking.model.claim.Claim)

Aggregations

OBErrorException (com.forgerock.openbanking.exceptions.OBErrorException)1 Claim (com.forgerock.openbanking.model.claim.Claim)1 JSONObject (com.nimbusds.jose.shaded.json.JSONObject)1 JWTClaimsSet (com.nimbusds.jwt.JWTClaimsSet)1 ParseException (java.text.ParseException)1