getProvider

AppDelegate.reachfive().getProvider(name)

Description

Retrieve a provider registered on the ReachFive client by name.

Refer at the iOS SDK Installation to initialize the providers at the client’s instantiation.

  • The scopes provided are the permissions setup in the provider’s configuration through the console.

Examples

  • Login

  • Logout

import IdentitySdkCore

let providerName: String = // Here paste the name of the provider

let scope = ["openid", "email", "profile", "phone", "full_write", "offline_access"]

AppDelegate
    .reachfive()
    .getProvider(name: providerName)?
    .login(
        scope: scope,
        origin: "home",
        viewController: self
    )
    .onSuccess{ authToken in
        // Get the profile's authentication token
    }
    .onFailure { error in
        // Return a ReachFive error
    }
import IdentitySdkCore

let providerName: String = // Here paste the name of the provider

AppDelegate
    .reachfive()
    .getProvider(name: providerName)?
    .logout()
    .onSuccess{ _ in
        // Do something
    }
    .onFailure { error in
        // Return a ReachFive error
    }

Parameters

name string

The name of the provider.

Response

Type: Provider

Provider

The provider which name matches the name passed in argument.

name string

The name of the provider.

login function

Expect the following arguments:

  • scope [String]: the list of the profile’s scopes. Make sure they are allowed by the client. Default scopes are the allowed scopes set up in the client’s configuration.

  • origin String: the origin of the call

  • viewController UIViewController: the class that manages the views of your iOS app.

It authenticates the profile with the provider otherwise it returns a ReachFiveError.

logout function

No argument is expected. Kill the SSO session of the profile otherwise returns a ReachFiveError.

Feedback