A newer version of this documentation is available.

View Latest

loginWithProvider

client.loginWithProvider(name, scope, origin, activity)

About this command

Authenticate the user with a social provider (Facebook, Google…​).

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

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

If the flow is performed through the web, then afer end-users have completed the OpenID flow, the ReachFive authorization server will redirect back to your application with an authorization code. Automatically complete the flow by calling onLoginActivityResult in your activity’s onActivityResult override.

Examples

import android.support.v7.app.AppCompatActivity
import com.reach5.identity.sdk.core.ReachFive

class MainActivity : AppCompatActivity() {
  // List the providers created on your ReachFive client
  val providers = ReachFive.getProviders()[0]
  // List of ReachFive scope values assigned to the user
  val scope = setOf("openid", "email", "profile", "phone_number", "offline_access", "events", "full_write")

  client.loginWithProvider(providers[0].name, scope, "home", this)
}

Parameters

name string

The name of the provider.

scope string[]

List of space-delimited, case-sensitive strings representing the requested scope.

origin string

Free text parameter describing the source of the login (only for reporting purposes).

activity Activity

The Android activity.

Response

Type: Unit