diff --git a/Sources/OktaIdx/Capabilities/IDXDuoCapability.swift b/Sources/OktaIdx/Capabilities/IDXDuoCapability.swift index b2d13249..66a7d36a 100644 --- a/Sources/OktaIdx/Capabilities/IDXDuoCapability.swift +++ b/Sources/OktaIdx/Capabilities/IDXDuoCapability.swift @@ -9,7 +9,7 @@ import Foundation extension Capability { /// Capability to access data related to Duo - public struct Duo: AuthenticatorCapability { + public class Duo: AuthenticatorCapability { public let host: String public let signedToken: String public let script: String @@ -27,5 +27,12 @@ extension Capability { signatureField.value = signatureData } + + init(host: String, signedToken: String, script: String, signatureData: String? = nil) { + self.host = host + self.signedToken = signedToken + self.script = script + self.signatureData = signatureData + } } } diff --git a/Sources/OktaIdx/Internal/Implementations/Version1/Responses/IDXClient+V1ResponseConstructors.swift b/Sources/OktaIdx/Internal/Implementations/Version1/Responses/IDXClient+V1ResponseConstructors.swift index a56010a0..a6e39e34 100644 --- a/Sources/OktaIdx/Internal/Implementations/Version1/Responses/IDXClient+V1ResponseConstructors.swift +++ b/Sources/OktaIdx/Internal/Implementations/Version1/Responses/IDXClient+V1ResponseConstructors.swift @@ -353,7 +353,7 @@ extension Capability.OTP { } extension Capability.Duo { - init?(flow: InteractionCodeFlowAPI, ion authenticators: [IonAuthenticator]) { + convenience init?(flow: InteractionCodeFlowAPI, ion authenticators: [IonAuthenticator]) { // Exit early if none of the authenticators have a "duo" method let methods = methodTypes(from: authenticators) guard methods.contains(.duo) else {