AuthenticationMethodOAuth2
public final class AuthenticationMethodOAuth2 : AuthenticationSingleStepMethod
A method that delegates authentication of the current user to a third-party identity provider, based on the OAuth 2.0 standard.
The user interaction with the provider is isolated from the rest of the application. It uses ASWebAuthenticationSession
.
-
The provider.
Declaration
Swift
public let oAuth2Provider: AuthenticationProvider.OAuth2Family
-
The scope requested to the OAuth 2.0 provider.
When
nil
, a default minimal scope depending on the provider is used.Declaration
Swift
public var scope: String?
-
The options passed to the OAuth 2.0 provider.
The following keys of this dictionary are ignored:
mode
,scope
andto
.Declaration
Swift
public var options: [String : Any]
-
Creates a new instance.
To make a
UIViewController
subclass conform to theASWebAuthenticationPresentationContextProviding
protocol, you can simply add the following method in its definition:func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { view.window ?? ASPresentationAnchor() }
Declaration
Swift
public convenience init(provider: AuthenticationProvider.OAuth2Family, presentationContextProvider: ASWebAuthenticationPresentationContextProviding, file: StaticString = #fileID, line: UInt = #line)
Parameters
provider
The OAuth 2.0 provider to user.
presentationContextProvider
A delegate that provides a display context in which the system can present an authentication session to the user.
file
The file from which the method is called. This is used for debugging purposes.
line
The line from which the method is called. This is used for debugging purposes.
-
Declaration
Swift
public var provider: AuthenticationProvider { get }
-
Declaration
Swift
public func initializeAuthentication(_: WebcomMarkers.Restricted, for service: AuthenticationService) -> WebcomResult<Void>
-
Declaration
Swift
public func authenticate(_: WebcomMarkers.Restricted, then completionCallback: @escaping WebcomResult<AuthenticationDetails>.Callback)
-
Declaration
Swift
public func terminateAuthentication(_: WebcomMarkers.Restricted)
-
Declaration
Swift
public var debugDescription: String { get }