Class A3LSignInOptions.Builder
- java.lang.Object
-
- com.amazon.A3L.authentication.api.signin.A3LSignInOptions.Builder
-
- Enclosing class:
- A3LSignInOptions
public static class A3LSignInOptions.Builder extends java.lang.Object
Builder forA3LSignInOptions
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Default Builder forA3LSignInOptions
which starts with clean configuration.Builder(A3LSignInOptions a3LSignInOptions)
A Builder forA3LSignInOptions
which you can specify one of the default configurations A3L Authentication (will) provide and make additional configurations based on it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description A3LSignInOptions
build()
Builds theA3LSignInOptions
object.A3LSignInOptions.Builder
requestEmail()
Specifies that email info is requested by your application.A3LSignInOptions.Builder
requestId()
Specifies that user ID is requested by your application.A3LSignInOptions.Builder
requestIdToken(java.lang.String serverClientId)
Specifies that an ID token for authenticated users is requested.A3LSignInOptions.Builder
requestProfile()
Specifies that user's profile info is requested by your application.A3LSignInOptions.Builder
requestScopes(Scope scope, Scope... scopes)
Specifies OAuth 2.0 scopes your application requests.A3LSignInOptions.Builder
setAccountName(java.lang.String accountName)
Specifies an account name on the device that should be used.A3LSignInOptions.Builder
setHostedDomain(java.lang.String hostedDomain)
Specifies a hosted domain restriction.
-
-
-
Constructor Detail
-
Builder
public Builder()
Default Builder forA3LSignInOptions
which starts with clean configuration. If you are trying to implement Sign In, i.e. you want to get back user identity, you can start with newA3LSignInOptions
(A3LSignInOptions.DEFAULT_SIGN_IN
),
-
Builder
public Builder(A3LSignInOptions a3LSignInOptions)
A Builder forA3LSignInOptions
which you can specify one of the default configurations A3L Authentication (will) provide and make additional configurations based on it. e.g.A3LSignInOptions.DEFAULT_SIGN_IN
.- Parameters:
a3LSignInOptions
- : Default A3LSignInOptions Configuration
-
-
Method Detail
-
requestId
public final A3LSignInOptions.Builder requestId()
Specifies that user ID is requested by your application.
-
requestEmail
public final A3LSignInOptions.Builder requestEmail()
Specifies that email info is requested by your application. Note that we don't recommend keying user by email address since email address might change. Keying user by ID is the preferable approach.
-
requestProfile
public final A3LSignInOptions.Builder requestProfile()
Specifies that user's profile info is requested by your application.
-
requestIdToken
public final A3LSignInOptions.Builder requestIdToken(@NonNull java.lang.String serverClientId)
Specifies that an ID token for authenticated users is requested. Requesting an ID token requires that the server client ID be specified.- Parameters:
serverClientId
- : The client ID of the server that will verify the integrity of the token.
-
requestScopes
public final A3LSignInOptions.Builder requestScopes(Scope scope, Scope... scopes)
Specifies OAuth 2.0 scopes your application requests. SeeScopes
for more information.- Parameters:
scope
- : An OAuth 2.0 scope requested by your app.scopes
- : More OAuth 2.0 scopes requested by your app.
-
setAccountName
public final A3LSignInOptions.Builder setAccountName(@NonNull java.lang.String accountName)
Specifies an account name on the device that should be used. If this is never called, the client will use the current default account for this application.- Parameters:
accountName
- : The account name on the device that should be used to sign in.
-
setHostedDomain
public final A3LSignInOptions.Builder setHostedDomain(@NonNull java.lang.String hostedDomain)
Specifies a hosted domain restriction. By setting this, sign in will be restricted to accounts of the user in the specified domain.- Parameters:
hostedDomain
- : domain of the user to restrict (for example, "mycollege.edu").
-
build
public final A3LSignInOptions build()
Builds theA3LSignInOptions
object.- Returns:
- A3LSignInOptions: a
A3LSignInOptions
instance.
-
-