Method guide

YandexAuthsdk Class

Authorization class. Instance methods:

Method Description
@NonNull 
public Intent createLoginIntent(@NonNull final Context context, @Nullable final Set<String> scopes, final long uid, @Nullable String loginHint)

Creates an Intent to start the authorization process.

uid: User ID, optional parameter. Used to open the authorization screen with user data. You can get the ID value by requesting user information.

loginHint: User login, optional parameter. Is automatically added to the authorization form if the device does not have an account with the user ID sent to uid.

public YandexAuthToken extractToken(final int resultCode, @Nullable final Intent data) throws YandexAuthException 

Handles the result of the authorization.

public String getJwt(@NonNull final YandexAuthToken token) throws YandexAuthException

Gets a JSON Web Token.

Method Description
@NonNull 
public Intent createLoginIntent(@NonNull final Context context, @Nullable final Set<String> scopes, final long uid, @Nullable String loginHint)

Creates an Intent to start the authorization process.

uid: User ID, optional parameter. Used to open the authorization screen with user data. You can get the ID value by requesting user information.

loginHint: User login, optional parameter. Is automatically added to the authorization form if the device does not have an account with the user ID sent to uid.

public YandexAuthToken extractToken(final int resultCode, @Nullable final Intent data) throws YandexAuthException 

Handles the result of the authorization.

public String getJwt(@NonNull final YandexAuthToken token) throws YandexAuthException

Gets a JSON Web Token.

YandexAuthOptions Class

SDK configuration class. Instance methods:

Method Description
public YandexAuthOptions(@NonNull final Context context, final boolean loggingEnabled) 

Creates an SDK configuration. The client app ID is taken from build.gradle.

loggingEnabled: Indicates that SDK message logging is permitted.

public String clientId() 
Returns the ID of the client app.
public boolean isLoggingEnabled() 
Returns a label indicating that SDK message logging is permitted.
Method Description
public YandexAuthOptions(@NonNull final Context context, final boolean loggingEnabled) 

Creates an SDK configuration. The client app ID is taken from build.gradle.

loggingEnabled: Indicates that SDK message logging is permitted.

public String clientId() 
Returns the ID of the client app.
public boolean isLoggingEnabled() 
Returns a label indicating that SDK message logging is permitted.

YandexAuthToken Class

A class that the SDK returns after successful authorization. Instance methods:

Method Description
public YandexAuthToken(@NonNull final String value, final long expiresIn)
Creates a token containing the token value and lifetime.
public String getValue()
Returns the value of the token.
public long expiresIn()
Returns the lifetime of the token.
Method Description
public YandexAuthToken(@NonNull final String value, final long expiresIn)
Creates a token containing the token value and lifetime.
public String getValue()
Returns the value of the token.
public long expiresIn()
Returns the lifetime of the token.