IDPChallengeSession
public struct IDPChallengeSession : ChallengeSession, Codable
extension IDPChallengeSession: Equatable
All relevant constraints needed for a successful challenge exchange
-
The verified challenge
Declaration
Swift
public let challenge: IDPChallenge
-
The verifier code used to request the
challenge
Declaration
Swift
public let verifierCode: VerifierCode
-
The state used for request the challenge
Declaration
Swift
public let state: String
-
A random string used for requesting the challenge
Declaration
Swift
public let nonce: String
-
Initialize an IDP Challenge session
Declaration
Swift
public init(challenge: IDPChallenge, verifierCode: VerifierCode, state: String, nonce: String)
Parameters
challenge
The challenge that should have been verified before
verifierCode
The verifier code used to start the challenge session
state
State used for requesting the challenge
nonce
Nonce used for requesting the challenge
-
Create the signed IDPChallenge response JWT
Declaration
Swift
public func sign( with signer: JWTSigner, using certificates: [Data], alg: JWT.Algorithm = .bp256r1, jsonEncoder _: JSONEncoder = JSONEncoder() ) -> AnyPublisher<SignedChallenge, Swift.Error>
Parameters
signer
JWT Signature provider
certificates
X.509 DER encoded certificate chain
alg
signature algorithm. Default: “BP256R1”
Return Value
signed JWT
-
Declaration
Swift
public func validateNonce(with idToken: String) throws -> Bool