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,scopeandto.Declaration
Swift
public var options: [String : Any]
-
Creates a new instance.
To make a
UIViewControllersubclass conform to theASWebAuthenticationPresentationContextProvidingprotocol, 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
providerThe OAuth 2.0 provider to user.
presentationContextProviderA delegate that provides a display context in which the system can present an authentication session to the user.
fileThe file from which the method is called. This is used for debugging purposes.
lineThe 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 }