Class TppEngineClient
java.lang.Object
io.getlime.security.powerauth.lib.tpp.engine.client.TppEngineClient
public class TppEngineClient extends Object
TPP Engine Client provides methods for communication with the TPP registry and consent engine.
It uses the Rest Client to handle REST API calls.
- Author:
- Petr Dvorak, petr@wultra.com, Roman Strobl, roman.strobl@wultra.com
-
Constructor Summary
Constructors Constructor Description TppEngineClient(com.wultra.core.rest.client.base.RestClientConfiguration restClientConfiguration)Create a new client with detailed configuration of REST client.TppEngineClient(String serviceUrl)Create a new client with provided base URL. -
Method Summary
Modifier and Type Method Description io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.ConsentDetailResponse>consentDetail(String id)Lookup consent details (details of a consent template).io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.UserConsentDetailResponse>consentStatus(String userId, String consentId, String clientId)Lookup consent status for given user and app.io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse>createApplication(io.getlime.security.powerauth.app.tppengine.model.request.CreateTppAppRequest request)Create an application with provided information.io.getlime.core.rest.model.base.response.ResponsedeleteApplication(String clientId, String tppLicense)Delete an application with provided information.io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse>fetchAppInfo(String clientId)Lookup information about a provided app.io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse>fetchAppInfoWithLicenseRestriction(String clientId, String tppLicense)Lookup information about a provided app.io.getlime.core.rest.model.base.response.ObjectResponse<List<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse>>fetchApplicationList(String tppLicense)Fetch list of TPP applications based on the license info.io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.GiveConsentResponse>giveConsent(io.getlime.security.powerauth.app.tppengine.model.request.GiveConsentRequest request)Give consent according to request parameters.io.getlime.core.rest.model.base.response.ResponserejectConsent(io.getlime.security.powerauth.app.tppengine.model.request.RemoveConsentRequest request)Reject consent according to request parameters.io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse>renewClientSecret(String clientId, String tppLicense)Renew the client secret for the application.io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse>updateApplication(String clientId, io.getlime.security.powerauth.app.tppengine.model.request.CreateTppAppRequest request)Update an application with provided client ID with a new information.
-
Constructor Details
-
TppEngineClient
Create a new client with provided base URL.- Parameters:
serviceUrl- Base service URL.- Throws:
TppEngineClientException- Thrown when REST client initialization fails.
-
TppEngineClient
public TppEngineClient(com.wultra.core.rest.client.base.RestClientConfiguration restClientConfiguration) throws TppEngineClientExceptionCreate a new client with detailed configuration of REST client.- Parameters:
restClientConfiguration- REST service client configuration.- Throws:
TppEngineClientException- Thrown when REST client initialization fails.
-
-
Method Details
-
consentDetail
public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.ConsentDetailResponse> consentDetail(String id) throws TppEngineClientExceptionLookup consent details (details of a consent template).- Parameters:
id- Username for user account which is being looked up.- Returns:
- Response with user details.
- Throws:
TppEngineClientException- Thrown when client request fails or user does not exist.
-
consentStatus
public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.UserConsentDetailResponse> consentStatus(String userId, String consentId, String clientId) throws TppEngineClientExceptionLookup consent status for given user and app.- Parameters:
userId- Username for user account which is being looked up.consentId- Identifier of a consent.clientId- Identifier of a TPP app.- Returns:
- Response with details of consent for given user and TPP app.
- Throws:
TppEngineClientException- Thrown when client request fails or user does not exist.
-
giveConsent
public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.GiveConsentResponse> giveConsent(io.getlime.security.powerauth.app.tppengine.model.request.GiveConsentRequest request) throws TppEngineClientExceptionGive consent according to request parameters.- Parameters:
request- Consent information.- Returns:
- Information about newly created consent.
- Throws:
TppEngineClientException- Thrown when client request fails or authentication fails.
-
rejectConsent
public io.getlime.core.rest.model.base.response.Response rejectConsent(io.getlime.security.powerauth.app.tppengine.model.request.RemoveConsentRequest request) throws TppEngineClientExceptionReject consent according to request parameters.- Parameters:
request- Consent information.- Returns:
- Static OK response. In case consent didn't exist, this operation is no-op.
- Throws:
TppEngineClientException- Thrown when client request fails or authentication fails.
-
fetchAppInfo
public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> fetchAppInfo(String clientId) throws TppEngineClientExceptionLookup information about a provided app.- Parameters:
clientId- Identifier of a TPP app.- Returns:
- Response with details TPP app with given client ID.
- Throws:
TppEngineClientException- Thrown when client request fails or app does not exist.
-
fetchAppInfoWithLicenseRestriction
public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> fetchAppInfoWithLicenseRestriction(String clientId, String tppLicense) throws TppEngineClientExceptionLookup information about a provided app.- Parameters:
clientId- Identifier of a TPP app.tppLicense- TPP license information.- Returns:
- Response with details TPP app with given client ID.
- Throws:
TppEngineClientException- Thrown when client request fails or app does not exist.
-
fetchApplicationList
public io.getlime.core.rest.model.base.response.ObjectResponse<List<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse>> fetchApplicationList(String tppLicense) throws TppEngineClientExceptionFetch list of TPP applications based on the license info.- Parameters:
tppLicense- TPP license information.- Returns:
- Response with details TPP app with given client ID.
- Throws:
TppEngineClientException- Thrown when client request fails or app does not exist.
-
createApplication
public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> createApplication(io.getlime.security.powerauth.app.tppengine.model.request.CreateTppAppRequest request) throws TppEngineClientExceptionCreate an application with provided information.- Parameters:
request- New application information.- Returns:
- Information about newly created application.
- Throws:
TppEngineClientException- Thrown when client request fails or user does not exist.
-
updateApplication
public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> updateApplication(String clientId, io.getlime.security.powerauth.app.tppengine.model.request.CreateTppAppRequest request) throws TppEngineClientExceptionUpdate an application with provided client ID with a new information.- Parameters:
clientId- Client ID of an app to be updated.request- New application information.- Returns:
- Information about newly created application.
- Throws:
TppEngineClientException- Thrown when client request fails or user does not exist.
-
renewClientSecret
public io.getlime.core.rest.model.base.response.ObjectResponse<io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse> renewClientSecret(String clientId, String tppLicense) throws TppEngineClientExceptionRenew the client secret for the application.- Parameters:
clientId- Client ID of an application to be refreshed.tppLicense- License information of TPP.- Returns:
- Information about newly created application.
- Throws:
TppEngineClientException- Thrown when client request fails or user does not exist.
-
deleteApplication
public io.getlime.core.rest.model.base.response.Response deleteApplication(String clientId, String tppLicense) throws TppEngineClientExceptionDelete an application with provided information.- Parameters:
clientId- Client ID of the app.tppLicense- License information of TPP.- Returns:
- Generic response.
- Throws:
TppEngineClientException- Thrown when client request fails or user does not exist.
-