AccountManager

An account manager used to instantiate, store and retrieve OAuth2 modules.

  • access a shared instance of an account manager

    Declaration

    Swift

    public class var sharedInstance: AccountManager
  • Instantiate an OAuth2 Module using the configuration object passed in and adds it to the account manager. It uses the OAuth2Session account_id as the name that this module will be stored in.

    Declaration

    Swift

    public class func addAccount(config: Config, moduleClass: OAuth2Module.Type) -> OAuth2Module

    Parameters

    config

    the configuration object to use to setup an OAuth2 module.

    moduleClass

    the type of the OAuth2 module to instantiate.

    Return Value

    the OAuth2 module

  • Removes an OAuth2 module

    Declaration

    Swift

    public class func removeAccount(name: String, config: Config, moduleClass: OAuth2Module.Type) -> OAuth2Module?

    Parameters

    name

    the name that the OAuth2 module was bound to.

    config

    the configuration object to use to setup an OAuth2 module.

    moduleClass

    the type of the OAuth2 module to instantiate.

    Return Value

    the OAuth2module or nil if not found

  • Retrieves an OAuth2 module by a name

    Declaration

    Swift

    public class func getAccountByName(name: String) -> OAuth2Module?

    Parameters

    name

    the name that the OAuth2 module was bound to.

    Return Value

    the OAuth2module or nil if not found.

  • Retrieves a list of OAuth2 modules bound to specific clientId.

    Declaration

    Swift

    public class func getAccountsByClienId(clientId: String) -> [OAuth2Module]

    Parameters

    clientId

    the client it that the oauth2 module was bound to.

    Return Value

    the OAuth2module or nil if not found.

  • Retrieves an OAuth2 module by using a configuration object.

    Declaration

    Swift

    public class func getAccountByConfig(config: Config) -> OAuth2Module?

    Parameters

    config

    the Config object that this oauth2 module was used to instantiate.

    Return Value

    the OAuth2module or nil if not found.

  • Convenient method to retrieve a Facebook oauth2 module.

    Declaration

    Swift

    public class func addFacebookAccount(config: FacebookConfig) -> FacebookOAuth2Module

    Parameters

    config

    a Facebook configuration object. See FacebookConfig.

    Return Value

    a Facebook OAuth2 module.

  • Convenient method to retrieve a Google oauth2 module ready to be used.

    Declaration

    Swift

    public class func addGoogleAccount(config: GoogleConfig) -> OAuth2Module

    Parameters

    config

    a google configuration object. See GoogleConfig.

    Return Value

    a google OAuth2 module.

  • Convenient method to retrieve a Keycloak oauth2 module ready to be used.

    Declaration

    Swift

    public class func addKeycloakAccount(config: KeycloakConfig) -> KeycloakOAuth2Module

    Parameters

    config

    a Keycloak configuration object. See KeycloakConfig.

    Return Value

    a Keycloak OAuth2 module.