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.
|
Usage
When using the viewController
property for .login
, you must ensure that your UIViewController implements the ASWebAuthenticationPresentationContextProviding
protocol.
To do this, add the following to your UIViewController
:
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
view.window!
}
This is not applicable for This only applies to providers that were not explicitly set in the provider list at configuration time. |
Examples
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
}
Response
Type: Provider
Provider
The provider which name matches the name passed in argument.
name |
The name of the provider. possible values
|
login |
Expect the following arguments:
It authenticates the profile with the provider otherwise it returns a |
logout |
No argument is expected. Kill the SSO session of the profile otherwise returns a |