init(clientID : String, authorizationEndpoint : URL, tokenEndpoint : URL, keychain: Keychain)
Initializes a DeviceAuthorizationFlow object.
Availability
Framework
convenience init(clientID: String, authorizationEndpoint: URL, tokenEndpoint: URL, keychain: Keychain, scopes: String)
clientID
The client identifier issued by the server.
authorizationEndpoint
The server authorization endpoint URL.
tokenEndpoint
The server token endpoint URL.
Keychain
An instance of Keychain from KeychainAccess. Full KeychainAccess documentation.
scopes
The scopes you want your app to be authorized for, separated by spaces.
This initializer calls init(client
, and initializes the scopes property.
Example Code:
// the "accessGroup" parameter is only necessary if you wish to share the keychain across
// multiple targets using a keychain sharing entitlement
let keychain = Keychain(service: "your.app.bundleID", accessGroup: "appIdentifierPrefix.your.app.bundleID")
.label("Your App Name")
let domain = DeviceAuthorizationFlow(
...
// The same as the other initializer.
...
scopes: "read-email-address modify-account"
)
init(clientID : String, authorizationEndpoint : URL, tokenEndpoint : URL, keychain: Keychain)