Class Xs2aAuthorisationService
- java.lang.Object
-
- de.adorsys.psd2.xs2a.service.authorization.Xs2aAuthorisationService
-
@Service public class Xs2aAuthorisationService extends Object
-
-
Constructor Summary
Constructors Constructor Description Xs2aAuthorisationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<de.adorsys.psd2.consent.api.authorisation.CreateAuthorisationResponse>createAuthorisation(de.adorsys.psd2.consent.api.authorisation.CreateAuthorisationRequest request, String parentId, de.adorsys.psd2.xs2a.core.authorisation.AuthorisationType authorisationType)Stores created authorisationOptional<de.adorsys.psd2.xs2a.core.authorisation.Authorisation>getAuthorisationById(String authorisationId)Requests CMS to retrieve authorisation by its identifierOptional<de.adorsys.psd2.xs2a.core.sca.AuthorisationScaApproachResponse>getAuthorisationScaApproach(String authorisationId)Gets SCA approach from the authorisationOptional<de.adorsys.psd2.xs2a.core.sca.ScaStatus>getAuthorisationScaStatus(String authorisationId, String parentId, de.adorsys.psd2.xs2a.core.authorisation.AuthorisationType authorisationType)Retrieves SCA status of authorisationOptional<List<String>>getAuthorisationSubResources(String parentId, de.adorsys.psd2.xs2a.core.authorisation.AuthorisationType authorisationType)Requests to retrieve authorisation IDs by parent IDbooleanisAuthenticationMethodDecoupled(String authorisationId, String authenticationMethodId)Requests CMS to retrieve authentication method and checks if requested authentication method is decoupled.booleansaveAuthenticationMethods(String authorisationId, List<de.adorsys.psd2.xs2a.core.authorisation.AuthenticationObject> methods)Saves authentication methods in provided authorisationde.adorsys.psd2.consent.api.CmsResponse<de.adorsys.psd2.xs2a.core.authorisation.Authorisation>updateAuthorisation(de.adorsys.psd2.consent.api.authorisation.UpdateAuthorisationRequest request, String authorisationId)voidupdateAuthorisationStatus(String authorisationId, de.adorsys.psd2.xs2a.core.sca.ScaStatus scaStatus)Sends a PUT request to CMS to update status in authorisationvoidupdateScaApproach(String authorisationId, de.adorsys.psd2.xs2a.core.profile.ScaApproach scaApproach)Updates SCA approach in authorisation
-
-
-
Method Detail
-
createAuthorisation
public Optional<de.adorsys.psd2.consent.api.authorisation.CreateAuthorisationResponse> createAuthorisation(de.adorsys.psd2.consent.api.authorisation.CreateAuthorisationRequest request, String parentId, de.adorsys.psd2.xs2a.core.authorisation.AuthorisationType authorisationType)
Stores created authorisation- Parameters:
parentId- String representation of identifier of stored parent- Returns:
- CreateAuthorisationResponse object with authorisation ID and scaStatus
-
getAuthorisationById
public Optional<de.adorsys.psd2.xs2a.core.authorisation.Authorisation> getAuthorisationById(String authorisationId)
Requests CMS to retrieve authorisation by its identifier- Parameters:
authorisationId- String representation of identifier of stored consent authorisation- Returns:
- Response contains Authorisation
-
updateScaApproach
public void updateScaApproach(String authorisationId, de.adorsys.psd2.xs2a.core.profile.ScaApproach scaApproach)
Updates SCA approach in authorisation- Parameters:
authorisationId- String representation of the authorisation identifierscaApproach- Chosen SCA approach
-
saveAuthenticationMethods
public boolean saveAuthenticationMethods(String authorisationId, List<de.adorsys.psd2.xs2a.core.authorisation.AuthenticationObject> methods)
Saves authentication methods in provided authorisation- Parameters:
authorisationId- String representation of the authorisation identifiermethods- List of authentication methods to be saved- Returns:
trueif authorisation was found and updated,falseotherwise
-
isAuthenticationMethodDecoupled
public boolean isAuthenticationMethodDecoupled(String authorisationId, String authenticationMethodId)
Requests CMS to retrieve authentication method and checks if requested authentication method is decoupled.- Parameters:
authorisationId- String representation of the authorisation identifierauthenticationMethodId- String representation of the available authentication method identifier- Returns:
true, if authentication method is decoupled andfalseotherwise.
-
updateAuthorisationStatus
public void updateAuthorisationStatus(String authorisationId, de.adorsys.psd2.xs2a.core.sca.ScaStatus scaStatus)
Sends a PUT request to CMS to update status in authorisation- Parameters:
authorisationId- String representation of authorisation identifierscaStatus- Enum for status of the SCA method applied
-
getAuthorisationScaApproach
public Optional<de.adorsys.psd2.xs2a.core.sca.AuthorisationScaApproachResponse> getAuthorisationScaApproach(String authorisationId)
Gets SCA approach from the authorisation- Parameters:
authorisationId- String representation of the authorisation identifier- Returns:
- SCA approach
-
getAuthorisationSubResources
public Optional<List<String>> getAuthorisationSubResources(String parentId, de.adorsys.psd2.xs2a.core.authorisation.AuthorisationType authorisationType)
Requests to retrieve authorisation IDs by parent ID- Parameters:
parentId- String representation of identifier of stored consent- Returns:
- list of consent authorisation IDs
-
updateAuthorisation
public de.adorsys.psd2.consent.api.CmsResponse<de.adorsys.psd2.xs2a.core.authorisation.Authorisation> updateAuthorisation(de.adorsys.psd2.consent.api.authorisation.UpdateAuthorisationRequest request, String authorisationId)
-
getAuthorisationScaStatus
public Optional<de.adorsys.psd2.xs2a.core.sca.ScaStatus> getAuthorisationScaStatus(String authorisationId, String parentId, de.adorsys.psd2.xs2a.core.authorisation.AuthorisationType authorisationType)
Retrieves SCA status of authorisation- Parameters:
parentId- String representation of consent identifierauthorisationId- String representation of authorisation identifier- Returns:
- SCA status of the authorisation
-
-