DeviceClientConfig
public struct DeviceClientConfig : Sendable
Configuration for DeviceClient
This struct encapsulates all configuration needed to initialize and operate the DeviceClient. All properties are required to ensure proper authentication and routing of device management requests.
Example:
let config = DeviceClientConfig(
serverUrl: "https://openam.example.com",
realm: "alpha",
cookieName: "iPlanetDirectoryPro",
ssoToken: "AQIC5w...",
httpClient: HttpClient()
)
-
The base URL of the server
Declaration
Swift
public let serverUrl: String -
The realm to use for device operations
Declaration
Swift
public let realm: String -
Cookie name for server configuration
Declaration
Swift
public let cookieName: String
-
The SSO (Single Sign-On) session token
Note
Token validity is not checked by DeviceClient; ensure token is valid before useDeclaration
Swift
public let ssoToken: String
-
The HTTP client used for network requests
Default: Creates a new
HttpClientProtocolinstance with default configurationDeclaration
Swift
public let httpClient: HttpClientProtocol
-
Initializes a new DeviceClientConfig
Creates a complete configuration for the DeviceClient with all required parameters.
Throws
Does not throw, but invalid URLs or tokens will cause runtime errors during API calls
Declaration
Swift
public init( serverUrl: String, realm: String = DeviceClientConstants.defaultRealm, cookieName: String = DeviceClientConstants.defaultCookieName, ssoToken: String, httpClient: HttpClientProtocol = HttpClient.createClient() )Parameters
serverUrlThe base URL of the server (e.g.,
"https://openam.example.com")realmThe realm for device operations (e.g.,
"alpha")cookieNameThe header name for the SSO token (e.g.,
"iPlanetDirectoryPro")ssoTokenThe SSO session token for authentication
httpClientThe HTTP client instance (default:
HttpClient.createClient())
View on GitHub