Search in sources :

Example 6 with POJOResponse

use of io.jans.ca.common.response.POJOResponse in project jans by JanssenProject.

the class ValidateOperation method execute.

@Override
public IOpResponse execute(ValidateParams params) throws Exception {
    validateParams(params);
    Rp rp = getRp();
    OpenIdConfigurationResponse discoveryResponse = getDiscoveryService().getConnectDiscoveryResponseByRpId(params.getRpId());
    final Jwt idToken = Jwt.parse(params.getIdToken());
    final Validator validator = new Validator.Builder().discoveryResponse(discoveryResponse).idToken(idToken).keyService(getKeyService()).opClientFactory(getOpClientFactory()).rpServerConfiguration(getConfigurationService().getConfiguration()).rp(rp).build();
    validator.validateNonce(getStateService());
    validator.validateIdToken(rp.getClientId());
    validator.validateAccessToken(params.getAccessToken());
    validator.validateAuthorizationCode(params.getCode());
    return new POJOResponse("");
}
Also used : POJOResponse(io.jans.ca.common.response.POJOResponse) Jwt(io.jans.as.model.jwt.Jwt) OpenIdConfigurationResponse(io.jans.as.client.OpenIdConfigurationResponse) Rp(io.jans.ca.server.service.Rp)

Aggregations

POJOResponse (io.jans.ca.common.response.POJOResponse)6 OpenIdConfigurationResponse (io.jans.as.client.OpenIdConfigurationResponse)2 JwkClient (io.jans.as.client.JwkClient)1 JwkResponse (io.jans.as.client.JwkResponse)1 UserInfoClient (io.jans.as.client.UserInfoClient)1 UserInfoRequest (io.jans.as.client.UserInfoRequest)1 UserInfoResponse (io.jans.as.client.UserInfoResponse)1 IntrospectionResponse (io.jans.as.model.common.IntrospectionResponse)1 Jwt (io.jans.as.model.jwt.Jwt)1 Command (io.jans.ca.common.Command)1 CorrectRptIntrospectionResponse (io.jans.ca.common.introspection.CorrectRptIntrospectionResponse)1 GetJwksResponse (io.jans.ca.common.response.GetJwksResponse)1 IOpResponse (io.jans.ca.common.response.IOpResponse)1 HttpException (io.jans.ca.server.HttpException)1 ConfigurationService (io.jans.ca.server.service.ConfigurationService)1 DiscoveryService (io.jans.ca.server.service.DiscoveryService)1 IntrospectionService (io.jans.ca.server.service.IntrospectionService)1 Rp (io.jans.ca.server.service.Rp)1 JSONObject (org.json.JSONObject)1