convenience init(clientID : String, authorizationEndpoint : URL, tokenEndpoint : URL, keychain: Keychain, scopes: String)
Initializes a DeviceAuthorizationFlow object, with scopes.
Availability
Framework
init(clientID: String, authorizationEndpoint: URL, tokenEndpoint: URL, keychain: Keychain)
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.
This initializer is called by init(client
.
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(
clientID: "9d73bfb50b304543b35f41d427e6b76c",
authorizationEndpoint: URL(string: "https://domain.com/authorize")!,
tokenEndpoint: URL(string: "https://domain.com/token")!,
keychain: keychain
)
convenience init(clientID : String, authorizationEndpoint : URL, tokenEndpoint : URL, keychain: Keychain, scopes: String)