init(clientID : String, authorizationEndpoint : URL, tokenEndpoint : URL, redirectURI : String, keychain: Keychain) Initializes a PKCEAuthorizationFlow object.
Availability
Framework
convenience init(clientID: String, authorizationEndpoint: URL, tokenEndpoint: URL, redirectURI: String, keychain: Keychain, scopes: String)clientIDThe client identifier issued by the server.
authorizationEndpointThe server authorization endpoint URL.
tokenEndpointThe server token endpoint URL.
redirectURIYour application’s redirect URI.
KeychainAn instance of Keychain from KeychainAccess. Full KeychainAccess documentation.
scopesThe 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 = PKCEAuthorizationFlow(
...
// The same as the other initializer.
...
scopes: "read-email-address modify-account"
)init(clientID : String, authorizationEndpoint : URL, tokenEndpoint : URL, redirectURI : String, keychain: Keychain)