AgsAuth
open class AgsAuthAeroGear Services Auth SDK
Allows users to perform login/logout actions against an Keycloak service provisioned by the AeroGear mobile service on OpenShift.
### Example ### initialise the authentication configuration service and configure the Auth SDK
 let authConfig = AuthenticationConfig(redirectURL: "com.youapp://callback")
 AgsAuth.instance.configure(authConfig: authConfig)
Login using the configured Auth SDK
 AgsAuth.instance.login()
- 
                  
                  instance of the Auth SDK DeclarationSwift public static let instance: <<error type>>
- 
                  
                  Errors generated by the auth module See moreDeclarationSwift public enum Errors : Error
- 
                  
                  Configure the Auth SDK. Important This function should be called before any other functions are invoked. Only need to call this once. Throws a noServiceConfigurationFounderror if no authentication configuration was found in themobileConfigused to initialise the Auth SDKDeclarationSwift public func configure(authConfig: AuthenticationConfig) throwsParametersauthConfigConfiguration options for the auth module 
- 
                  
                  Perform user login action. Throws aserviceNotConfigurederror if the Auth SDK has not been configuredDeclarationSwift public func login(presentingViewController: UIViewController, onCompleted: @escaping (_ user: User?, _ error: Error?) -> Void) throwsParameterspresentingViewControllerthe ViewController that initiates the login process onCompletedcallback function that will be invoked when the login is finished userthe user returned in the onCompletedcallback function. Will be nil if login failederrorthe error returned in the onCompletedcallback function. Will be nil if login was successful
- 
                  
                  Resume the authentication process. This function should be invoked when the user has finished logging in via the browser and redirected back to the app that started the login. Throws a serviceNotConfigurederror if the Auth SDK has not been configuredDeclarationSwift public func resumeAuth(url: URL) throws -> BoolParametersurlThe redirect url passed backed from the login process Return Valuetrue if the login process can be resumed, false otherwise 
- 
                  
                  Perform the logout action. Throws a serviceNotConfigurederror if the Auth SDK has not been configured or anoLoggedInUserErrorif no user is logged inDeclarationSwift public func logout(onCompleted: @escaping (_ error: Error?) -> Void) throwsParametersonCompletedcallback function that will be invoked when the logout process has completed errorthe serviceNotConfigurederror returned in theonCompletedcallback function
- 
                  
                  Get the current logged in user. Throws a serviceNotConfigurederror if the Auth SDK has not been configuredDeclarationSwift public func currentUser() throws -> User?Return Valuethe user that is currently logged in 
 AgsAuth Class Reference
        AgsAuth Class Reference