Class BankIDClientImpl
java.lang.Object
se.swedenconnect.bankid.rpapi.service.impl.BankIDClientImpl
- All Implemented Interfaces:
BankIDClient
An implementation of the BankID Relying Party API methods.
- Author:
- Martin Lindström
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBankIDClientImpl(String identifier, WebClient webClient, QRGenerator qrGenerator) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<OrderResponse> authenticate(AuthenticateRequest request) Initiates an authentication operation.reactor.core.publisher.Mono<Void> Cancels an ongoing order.reactor.core.publisher.Mono<? extends CollectResponse> Collects the result fromBankIDClient.authenticate(AuthenticateRequest)orBankIDClient.sign(SignatureRequest).The unique identifier for this client.Returns the QR generator that should be used to generate QR codes.reactor.core.publisher.Mono<OrderResponse> sign(SignatureRequest request) Initiates a signature operation.
-
Field Details
-
EXECUTOR_SERVICE
The executor service.
-
-
Constructor Details
-
BankIDClientImpl
Constructor.- Parameters:
identifier- the unique client identifierwebClient- theWebClientthat we use to send requests to the BankID serverqrGenerator- the QR code generator (may benullif QR codes are not used)
-
-
Method Details
-
getIdentifier
The unique identifier for this client. This is mainly important when we use more than one client, for example if we implement an IdP that serves several relying parties, and each RP has a client of its own.- Specified by:
getIdentifierin interfaceBankIDClient- Returns:
- the unique identifier
-
authenticate
public reactor.core.publisher.Mono<OrderResponse> authenticate(AuthenticateRequest request) throws BankIDException Initiates an authentication operation.- Specified by:
authenticatein interfaceBankIDClient- Parameters:
request- the authentication request parameters- Returns:
- an
OrderResponse - Throws:
BankIDException
-
sign
public reactor.core.publisher.Mono<OrderResponse> sign(SignatureRequest request) throws BankIDException Initiates a signature operation.- Specified by:
signin interfaceBankIDClient- Parameters:
request- the signature request parameters- Returns:
- an
OrderResponse - Throws:
BankIDException
-
cancel
Cancels an ongoing order.- Specified by:
cancelin interfaceBankIDClient- Parameters:
orderReference- the order reference- Throws:
BankIDException- for errors
-
collect
public reactor.core.publisher.Mono<? extends CollectResponse> collect(String orderReference) throws BankIDException Collects the result fromBankIDClient.authenticate(AuthenticateRequest)orBankIDClient.sign(SignatureRequest).- Specified by:
collectin interfaceBankIDClient- Parameters:
orderReference- the unique order reference- Returns:
- a collect response object
- Throws:
BankIDException- for errors
-
getQRGenerator
Returns the QR generator that should be used to generate QR codes.- Specified by:
getQRGeneratorin interfaceBankIDClient- Returns:
- a
QRGeneratorornullif no QR code generator has been configured
-