Class A3LSignIn

java.lang.Object
com.amazon.A3L.authentication.api.signin.A3LSignIn

public class A3LSignIn extends Object
Contains abstraction for GoogleSignIn Entry point for the A3LAuth API
  • Constructor Details

    • A3LSignIn

      public A3LSignIn()
  • Method Details

    • getClient

      public static A3LSignInClient getClient(@NonNull Context context, @NonNull A3LSignInOptions a3LSignInOptions)
      Create a new instance of A3LSignInClient. Fetches client according to the current service chosen, AppAuth or Google. While in both cases A3LSignInClient is returned, the object contains Google or AppAuth clients depending on the current service.
      Parameters:
      context - : A Context used to provide information about the application's environment.
      a3LSignInOptions - : A A3LSignInOptions used to configure the A3LSignInClient. It is recommended to build out a A3LSignInOptions starting with new A3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN), configuring ID token in options if you have a server and adding all the scopes needed in A3LSignInOptions.Builder.requestScopes(Scope, Scope...).
      Returns:
      A3LSignInClient: A instance of A3LSignInClient
    • getClient

      public static A3LSignInClient getClient(@NonNull Activity activity, @NonNull A3LSignInOptions a3LSignInOptions)
      Create a new instance of A3LSignInClient. Fetches client according to the current service chosen, AppAuth or Google. While in both cases A3LSignInClient is returned, the object contains Google or AppAuth clients depending on the current service.
      Parameters:
      activity - : An Activity that will be used to manage the lifecycle of the GoogleSignInClient.
      a3LSignInOptions - : A A3LSignInOptions used to configure the A3LSignInClient. It is recommended to build out a A3LSignInOptions starting with new A3LSignInOptions.Builder(A3LSignInOptions.DEFAULT_SIGN_IN), configuring ID token in options if you have a server and adding all the scopes needed in A3LSignInOptions.Builder.requestScopes(Scope, Scope...).
      Returns:
      A3LSignInClient: A instance of A3LSignInClient
    • getLastSignedInAccount

      public static A3LSignInAccount getLastSignedInAccount(@NonNull Context context)
      Gets the last account that the user signed in with.
      Parameters:
      context - : A Context used to provide information about the application's environment.
      Returns:
      A3LSignInAccount: A3LSignInAccount from last known successful sign-in. If user has never signed in before or has signed out / revoked access, null is returned
    • hasPermissions

      public static boolean hasPermissions(@NonNull A3LSignInAccount account, @NonNull String... scopes)
      Determines if the given account has been granted permission to all given scopes.
      Parameters:
      account - : the A3LSignInAccount to be checked
      scopes - : the collection of scopes to be checked.
      Returns:
      boolean: true if the given account has been granted permission to all given scopes.
    • getSignedInAccountFromIntent

      public static com.google.android.gms.tasks.Task<A3LSignInAccount> getSignedInAccountFromIntent(@NonNull Intent data)
      Method to fetch an A3LTask representing the Sign in for current intent.
      Parameters:
      data - : the Intent returned via android.app.Activity#onActivityResult(int, int, Intent) when sign in completed.
      Returns:
      Task: A completed Task containing a A3LSignInAccount object.