TwitchAuthorizationManager
@available(iOS 13.0, *)
public class TwitchAuthorizationManager
The TwitchAuthorizationManager
is responsible for managing the oauth2 bearer token flow with the Twitch server.
-
Singleton instance of the Authorization manager.
Declaration
Swift
public static let sharedInstance: TwitchAuthorizationManager
-
The Client Id used for authorization.
Declaration
Swift
public var clientID: String?
-
The Client Secret used for authorization.
Declaration
Swift
public var clientSecret: String?
-
The Redirect URI used for authorization.
Declaration
Swift
public var redirectURI: String?
-
The scopes the user is authorized.
Declaration
Swift
public var scopes: String?
-
Authorization token Read Only.
Declaration
Swift
public var authToken: String? { get }
-
Scopes authorized from server Read Only.
Declaration
Swift
public var authorizedScopes: [String]? { get }
-
View controller that will present the webview for authorization, the “app context”
Declaration
Swift
public var contextProvider: UIViewController?
-
Credentials from the server, contains authorized scopes and the auth token this can be used to set the auth token without going through the built in authorization flow
Declaration
Swift
public var credentials: Credentials? { get set }
-
Returns true if a valid authorization token exists.
Declaration
Swift
public func hasOAuthToken() -> Bool
-
Starts the Twitch authorization flow with the Server.
Throws
throwsAuthorizationError
.Declaration
Swift
public func login() throws
-
Removes users credentials from the app forcing re-authentication with Twitch
Declaration
Swift
public func logout() throws