DeviceAuthorizationResponse

public struct DeviceAuthorizationResponse : Decodable, Sendable

Represents the server response to a device authorization request (RFC 8628).

  • The device verification code.

    Declaration

    Swift

    public let deviceCode: String
  • The end-user verification code.

    Declaration

    Swift

    public let userCode: String
  • The end-user verification URI on the authorization server.

    Declaration

    Swift

    public let verificationUri: String
  • An optional verification URI that includes the user_code for non-textual transmission.

    Declaration

    Swift

    public let verificationUriComplete: String?
  • The lifetime in seconds of the deviceCode and userCode.

    Declaration

    Swift

    public let expiresIn: Int
  • The minimum amount of time in seconds the client should wait between polling requests. Defaults to 5 if absent from the server response.

    Declaration

    Swift

    public let interval: Int
  • Decodes a DeviceAuthorizationResponse from the standard RFC 8628 JSON representation, mapping snake-case JSON keys to camelCase properties. interval defaults to 5 seconds when omitted by the server.

    Declaration

    Swift

    public init(from decoder: Decoder) throws