Class BankIdSessions
java.lang.Object
se.swedenconnect.bankid.idp.authn.session.BankIdSessions
- All Implemented Interfaces:
BankIdSessionReader
,BankIdSessionWriter
@Service
public class BankIdSessions
extends Object
implements BankIdSessionWriter, BankIdSessionReader
Implements the writing and reading of BankID session data.
- Author:
- Martin Lindström, Felix Hellman
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(jakarta.servlet.http.HttpServletRequest request) Deletes everything except device selection for finalized authentication.loadCompletionData
(jakarta.servlet.http.HttpServletRequest request) Loads finalCollectResponse
.loadContext
(jakarta.servlet.http.HttpServletRequest request) Loads the BankID context.loadPreviousSelectedDevice
(jakarta.servlet.http.HttpServletRequest request) Loads device selection.loadSessionData
(jakarta.servlet.http.HttpServletRequest request) Loads session data.loadUserVisibleData
(jakarta.servlet.http.HttpServletRequest request) Loads uservisible data.void
save
(jakarta.servlet.http.HttpServletRequest request, PreviousDeviceSelection previousDeviceSelection) Loads previous device selection from successful authentication.void
save
(jakarta.servlet.http.HttpServletRequest request, BankIdSessionData data) SavesBankIdSessionData
to repository.void
save
(jakarta.servlet.http.HttpServletRequest request, UserVisibleData userVisibleData) Loads user visible data to be displayed in BankID application.void
save
(jakarta.servlet.http.HttpServletRequest request, CollectResponse data) Saves the finalCollectResponse
that contains CompletionData.
-
Constructor Details
-
BankIdSessions
Constructor.- Parameters:
sessionDao
- the underlying data access object for storing BankID sessions
-
-
Method Details
-
save
SavesBankIdSessionData
to repository. Overwrites data if order reference is the same.- Specified by:
save
in interfaceBankIdSessionWriter
- Parameters:
request
- to determine session keydata
- to be saved
-
save
Saves the finalCollectResponse
that contains CompletionData.- Specified by:
save
in interfaceBankIdSessionWriter
- Parameters:
request
- to determine session keydata
- to be saved
-
delete
public void delete(jakarta.servlet.http.HttpServletRequest request) Deletes everything except device selection for finalized authentication.- Specified by:
delete
in interfaceBankIdSessionWriter
- Parameters:
request
- to determine session key
-
save
public void save(jakarta.servlet.http.HttpServletRequest request, PreviousDeviceSelection previousDeviceSelection) Loads previous device selection from successful authentication.- Specified by:
save
in interfaceBankIdSessionWriter
- Parameters:
request
- to determine session keypreviousDeviceSelection
- device used for authentication
-
loadSessionData
Loads session data.- Specified by:
loadSessionData
in interfaceBankIdSessionReader
- Parameters:
request
- the current request for the user to determine session key- Returns:
- a
BankIdSessionState
-
loadCompletionData
Loads finalCollectResponse
.- Specified by:
loadCompletionData
in interfaceBankIdSessionReader
- Parameters:
request
- the current request for the user to determine session key- Returns:
- the final
CollectResponse
from the BankID API containing CompletionData
-
loadPreviousSelectedDevice
public PreviousDeviceSelection loadPreviousSelectedDevice(jakarta.servlet.http.HttpServletRequest request) Loads device selection.- Specified by:
loadPreviousSelectedDevice
in interfaceBankIdSessionReader
- Parameters:
request
- the current request for the user to determine session key- Returns:
- device selection from last successful authentication for the current user
-
loadUserVisibleData
Loads uservisible data.- Specified by:
loadUserVisibleData
in interfaceBankIdSessionReader
- Parameters:
request
- the current request for the user to determine session key- Returns:
- user visible data to be displayed in app
-
save
Loads user visible data to be displayed in BankID application.- Specified by:
save
in interfaceBankIdSessionWriter
- Parameters:
request
- to determine session keyuserVisibleData
- message that should be displayed in app
-
loadContext
Loads the BankID context.- Specified by:
loadContext
in interfaceBankIdSessionReader
- Parameters:
request
- the servlet request- Returns:
- a
BankIdContext
-