public class AuthService
extends java.lang.Object
implements org.aerogear.mobile.core.ServiceModule
| Constructor and Description |
|---|
AuthService()
Instantiates a new AuthService object
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.aerogear.mobile.core.MobileCore core,
org.aerogear.mobile.core.configuration.ServiceConfiguration serviceConfiguration) |
UserPrincipal |
currentUser()
Return the user that is currently logged and is still valid.
|
void |
deleteTokens()
Delete the the current tokens/authentication state.
|
void |
handleAuthResult(android.content.Intent data)
This function should be called in the start activity's "onActivityResult" method to allow the
SDK to process the response from the authentication server.
|
void |
init(android.content.Context context,
AuthServiceConfiguration authServiceConfiguration)
Initialize the module.
|
void |
init(android.content.Context context,
AuthServiceConfiguration authServiceConfiguration,
BrowserConfiguration browserConfiguration)
Initialize the module.
|
void |
login(DefaultAuthenticateOptions authOptions,
org.aerogear.mobile.core.Callback<UserPrincipal> callback)
Log in the user with the given authentication options.
|
void |
logout(UserPrincipal principal,
org.aerogear.mobile.core.Callback<UserPrincipal> callback)
Log out the given principal.
|
boolean |
requiresConfiguration() |
java.lang.String |
type() |
public UserPrincipal currentUser()
public void login(@NonNull
DefaultAuthenticateOptions authOptions,
@NonNull
org.aerogear.mobile.core.Callback<UserPrincipal> callback)
authOptions - the authentication optionscallback - the callback function that will be invoked with the user infopublic void deleteTokens()
public void handleAuthResult(@NonNull
android.content.Intent data)
data - The intent data that is passed to "onActivityResult"public void logout(@NonNull
UserPrincipal principal,
@NonNull
org.aerogear.mobile.core.Callback<UserPrincipal> callback)
principal - principal to be logged outcallback - the callback function to be invokedpublic java.lang.String type()
type in interface org.aerogear.mobile.core.ServiceModulepublic void configure(org.aerogear.mobile.core.MobileCore core,
org.aerogear.mobile.core.configuration.ServiceConfiguration serviceConfiguration)
configure in interface org.aerogear.mobile.core.ServiceModulepublic void init(android.content.Context context,
AuthServiceConfiguration authServiceConfiguration)
context - the current application contextauthServiceConfiguration - the configuration of the auth servicepublic void init(android.content.Context context,
AuthServiceConfiguration authServiceConfiguration,
BrowserConfiguration browserConfiguration)
context - the current application contextauthServiceConfiguration - the configuration of the auth servicebrowserConfiguration - the configuration for the browser used during authenticationpublic boolean requiresConfiguration()
requiresConfiguration in interface org.aerogear.mobile.core.ServiceModule