IDPSession
public protocol IDPSession
IDPSession acts as an interactor/mediator for the IDPClient and IDPStorage sourcery: StreamWrapped
-
Whether the session has access to a (valid) authenticated session (e.g. token)
Declaration
Swift
var isLoggedIn: AnyPublisher<Bool, IDPError> { get } -
Invalidates the active token. Use to logout the user or mark the existing Session as invalid, e.g. due to an 403/forbidden server response.
Declaration
Swift
func invalidateAccessToken() -
Request a challenge from the IDPClient for certain scopes
Declaration
Swift
func requestChallenge() -> AnyPublisher<IDPChallengeSession, IDPError>Return Value
Published
IDPChallengeSession -
Verify the signed challenge
Declaration
Swift
func verify(_ signedChallenge: SignedChallenge) -> AnyPublisher<IDPExchangeToken, IDPError>Parameters
signedChallengethe received challenge
Return Value
-
Exchange the token with verifier for the actual token
Declaration
Swift
func exchange( token: IDPExchangeToken, challengeSession: ChallengeSession, idTokenValidator: @escaping (TokenPayload.IDTokenPayload) -> Result<Bool, Error> ) -> AnyPublisher<IDPToken, IDPError>Parameters
tokenthe exchange token
challengeSessionA challengeSession with verifier code for the challenge
idTokenValidatorClosure that validates the passed IDToken for the selected profile
Return Value
Publisher of the received IDPToken
-
Pairs the device with a biometric key.
Declaration
Swift
func pairDevice(with registrationData: RegistrationData, token: IDPToken) -> AnyPublisher<PairingEntry, IDPError>Parameters
registrationDataRegistrationDatacontaining information about the biometric key to register.tokenAccesstoken for authentication and authorization for the new key.
Return Value
AnyPublisher with a
PairingEntrycontaining registration information upon success. -
Unregisters the devices key with the given identifier.
Declaration
Parameters
keyIdentifierKey identifier to unregister.
tokenAccesstoken for authentication and authorization for the new key.
Return Value
AnyPublisher with a
Boolcontainingtrueupon success,falseotherwise. -
Returns the list of all registered devices.
Declaration
Swift
func listDevices(token: IDPToken) -> AnyPublisher<PairingEntries, IDPError>Parameters
tokenAccesstoken for authentication and authorization for the new key.
Return Value
AnyPublisher with a
PairingEntriescontaining all registered devices. -
Verify a given challenge with the IDP using alternative authentication, a.k.a. biometric secured key.
Declaration
Swift
func altVerify(_ signedChallenge: SignedAuthenticationData) -> AnyPublisher<IDPExchangeToken, IDPError>Parameters
signedChallengeSignedAuthenticationDatathat is signed with a biometric key instead of an eGK.Return Value
AnyPublisher with
IDPExchangeTokenif successfull, fails with anIDPErrorotherwise. -
Load available Insurance companies that are capable of External Authentication (gID).
Declaration
Swift
func loadDirectoryKKApps() -> AnyPublisher<KKAppDirectory, IDPError> -
Initial step for external authentication with insurance company app.
Declaration
Swift
func startExtAuth(entry: KKAppDirectory.Entry) -> AnyPublisher<URL, IDPError>Parameters
entryThe reference to an insurance company app to user for the authentication.
-
Follow up step whenever an insurance company app authorizes a user login.
Declaration
Parameters
urlUniversal link containing login information
idTokenValidatorClosure that validates the passed IDToken for the selected profile
-
verifyAndExchange(signedChallenge:Extension methodidTokenValidator: ) Verify signed challenge and immediately exchange the token
Declaration
Swift
public func verifyAndExchange( signedChallenge: SignedChallenge, idTokenValidator: @escaping (TokenPayload.IDTokenPayload) -> Result<Bool, Error> ) -> AnyPublisher<IDPToken, IDPError>Parameters
signedChallengesinged challenge
idTokenValidatorClosure that validates the passed IDToken for the selected profile
-
exchange(token:Extension methodchallengeSession: ) Exchange the token with verifier for the actual token
Declaration
Swift
public func exchange(token: IDPExchangeToken, challengeSession: ChallengeSession) -> AnyPublisher<IDPToken, IDPError>Parameters
tokenthe exchange token
challengeSessionA challengeSession with verifier code for the challenge
redirectURIoptional redirect URI to use for the token exchange.
Return Value
Publisher of the received IDPToken
View on GitHub
IDPSession Protocol Reference