Search in sources :

Example 21 with OIDCRegistrationResponse

use of com.forgerock.openbanking.model.oidc.OIDCRegistrationResponse in project openbanking-aspsp by OpenBankingToolkit.

the class AspspApiClientImpl method onboard.

@Override
public OIDCRegistrationResponse onboard(RestTemplate restTemplate, String onboardingEndpoint, String registrationRequestJwtSerialised) {
    ParameterizedTypeReference<OIDCRegistrationResponse> ptr = new ParameterizedTypeReference<OIDCRegistrationResponse>() {
    };
    UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(onboardingEndpoint);
    URI uri = builder.build().encode().toUri();
    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(MediaType.valueOf("application/jwt"));
    HttpEntity<String> request = new HttpEntity<>(registrationRequestJwtSerialised, headers);
    LOGGER.debug("Onboard software state on endpoint {}", onboardingEndpoint);
    return restTemplate.exchange(uri, HttpMethod.POST, request, ptr).getBody();
}
Also used : OIDCRegistrationResponse(com.forgerock.openbanking.model.oidc.OIDCRegistrationResponse) ParameterizedTypeReference(org.springframework.core.ParameterizedTypeReference) UriComponentsBuilder(org.springframework.web.util.UriComponentsBuilder) URI(java.net.URI)

Example 22 with OIDCRegistrationResponse

use of com.forgerock.openbanking.model.oidc.OIDCRegistrationResponse in project openbanking-aspsp by OpenBankingToolkit.

the class AspspApiClientImpl method getOnboardingResult.

@Override
public OIDCRegistrationResponse getOnboardingResult(RestTemplate restTemplate, String onboardingEndpoint) {
    ParameterizedTypeReference<OIDCRegistrationResponse> ptr = new ParameterizedTypeReference<OIDCRegistrationResponse>() {
    };
    UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(onboardingEndpoint);
    URI uri = builder.build().encode().toUri();
    LOGGER.debug("Get onboard result from enpoint {}", onboardingEndpoint);
    return restTemplate.exchange(uri, HttpMethod.GET, null, ptr).getBody();
}
Also used : OIDCRegistrationResponse(com.forgerock.openbanking.model.oidc.OIDCRegistrationResponse) ParameterizedTypeReference(org.springframework.core.ParameterizedTypeReference) UriComponentsBuilder(org.springframework.web.util.UriComponentsBuilder) URI(java.net.URI)

Aggregations

OIDCRegistrationResponse (com.forgerock.openbanking.model.oidc.OIDCRegistrationResponse)22 Tpp (com.forgerock.openbanking.model.Tpp)19 Test (org.junit.Test)9 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)6 SignedJWT (com.nimbusds.jwt.SignedJWT)5 ApiClientIdentity (com.forgerock.openbanking.common.services.onboarding.apiclient.ApiClientIdentity)4 RegistrationRequest (com.forgerock.openbanking.common.services.onboarding.registrationrequest.RegistrationRequest)4 OAuth2InvalidClientException (com.forgerock.openbanking.common.error.exception.oauth2.OAuth2InvalidClientException)3 X509Authentication (com.forgerock.spring.security.multiauth.model.authentication.X509Authentication)3 OBRIRole (com.forgerock.openbanking.model.OBRIRole)2 URI (java.net.URI)2 ParseException (java.text.ParseException)2 ParameterizedTypeReference (org.springframework.core.ParameterizedTypeReference)2 ResponseEntity (org.springframework.http.ResponseEntity)2 UriComponentsBuilder (org.springframework.web.util.UriComponentsBuilder)2 RoleOfPsp (com.forgerock.cert.psd2.RoleOfPsp)1 AMGateway (com.forgerock.openbanking.am.gateway.AMGateway)1 ManualRegistrationApplication (com.forgerock.openbanking.common.model.onboarding.ManualRegistrationApplication)1 ManualRegistrationRequest (com.forgerock.openbanking.common.model.onboarding.ManualRegistrationRequest)1 RedirectionAction (com.forgerock.openbanking.common.model.rcs.RedirectionAction)1