use of com.forgerock.openbanking.common.services.onboarding.apiclient.ApiClientIdentity in project openbanking-aspsp by OpenBankingToolkit.
the class ManualRegistrationApiController method getOrganizationIdentifier.
@Override
public ResponseEntity<String> getOrganizationIdentifier(Principal principal) throws OAuth2InvalidClientException {
try {
ApiClientIdentity apiClientIdentity = identityFactory.getApiClientIdentity(principal);
String organizationIdentifier = apiClientIdentity.getAuthorisationNumber().orElseThrow(() -> new OAuth2InvalidClientException("Could not get OrganizationIdentifier from " + "certificate"));
return ResponseEntity.status(HttpStatus.OK).body(organizationIdentifier);
} catch (ApiClientException e) {
log.info("getOrganizationIdentifier() caught ApiClientException; ", e);
throw new OAuth2InvalidClientException("Failed to obtain OrganizationIdentifier from certificate");
}
}
Aggregations