AeroGear Android Libary 1.0.1

org.jboss.aerogear.android.authentication
Interface AuthenticationModule

All Known Subinterfaces:
LoaderAuthenticationModule
All Known Implementing Classes:
AbstractAuthenticationModule, AGSecurityAuthenticationModule, AuthenticationModuleAdapter, HttpBasicAuthenticationModule, SupportAuthenticationModuleAdapter

public interface AuthenticationModule

A module which can authenticate a user. It also provides the necessary tools to log a user in, out, and modify requests from a Pipe so they are seen as authenticated.


Method Summary
 void enroll(Map<String,String> userData, Callback<HeaderAndBody> callback)
          Will try to register a user with a service using userData.
 AuthorizationFields getAuthorizationFields()
          This method is called be Pipe implementations when they need security applied to their HttpProvider.
 URL getBaseURL()
           
 String getEnrollEndpoint()
           
 String getLoginEndpoint()
           
 String getLogoutEndpoint()
           
 boolean isLoggedIn()
           
 void login(String username, String password, Callback<HeaderAndBody> callback)
          Will try to log in a user using username and password.
 void logout(Callback<Void> callback)
          Performs a logout of the current user.
 

Method Detail

getBaseURL

URL getBaseURL()

getLoginEndpoint

String getLoginEndpoint()

getLogoutEndpoint

String getLogoutEndpoint()

getEnrollEndpoint

String getEnrollEndpoint()

enroll

void enroll(Map<String,String> userData,
            Callback<HeaderAndBody> callback)
Will try to register a user with a service using userData.

It will call the callbacks onSuccess with a parameter of a Map of the values returned by the enroll service or onFailure if there is an error

Parameters:
userData -
callback -

login

void login(String username,
           String password,
           Callback<HeaderAndBody> callback)
Will try to log in a user using username and password.

It will call the callbacks onSuccess with a parameter of a Map of the values returned by the enroll service or onFailure if there is an error

Parameters:
username -
password -
callback -

logout

void logout(Callback<Void> callback)
Performs a logout of the current user.

It will call callback.onSuccess with no value on success and callback.onFailure if there is an error.

Parameters:
callback -

isLoggedIn

boolean isLoggedIn()
Returns:
true if the module has been logged in successfully

getAuthorizationFields

AuthorizationFields getAuthorizationFields()
This method is called be Pipe implementations when they need security applied to their HttpProvider. The headers/data/query parameters returned should be applied to the Url and HttpProvider directly before a call.

Returns:
the current AuthorizationFields for security

AeroGear Android Libary 1.0.1

Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.