Class AuthenticationAPI
- java.lang.Object
-
- com.cheetahdigital.corekit.models.module.Controller
-
- com.cheetahdigital.corekit.authentication.core.api.AuthenticationAPI
-
- All Implemented Interfaces:
RestController
public class AuthenticationAPI extends Controller
Cheetah Loyalty Authentication API Module AAuthentication
represents one User's Authentication Details.
-
-
Field Summary
-
Fields inherited from class com.cheetahdigital.corekit.models.module.Controller
STANDARD_DATE_FORMAT, TIMEZONE_DATE_FORMAT
-
-
Constructor Summary
Constructors Constructor Description AuthenticationAPI()
-
Method Summary
-
Methods inherited from class com.cheetahdigital.corekit.models.module.Controller
createCache, createHttpClient, createRetrofitInterface, evictAllCache, getGsonConfiguration, getRestAdapter, getTimeoutConnectionInSeconds, getTimeoutSocketInSeconds, initialize, removeResponsesFromCache
-
-
-
-
Method Detail
-
signup
public void signup(AuthenticationFieldParams fieldParams, Listener<SuccessResponse> listener)
Sign up the current user with the given credentials.- Parameters:
fieldParams
-AuthenticationFieldParams
listener
- listener once user sign up is successful or not
-
login
public void login(AuthenticationFieldParams fieldParams, Listener<Authentication> callback)
Login an account- Parameters:
fieldParams
- theAuthenticationFieldParams
callback
- handles the result of API
-
refreshToken
public Authentication refreshToken(AuthenticationFieldParams fieldParams)
Refresh the currently stored Loyalty API Access Token. Usually done after checking ifSdk.isTokenExpired()
. If error 4005 is encountered, logout the app.- Parameters:
fieldParams
-AuthenticationFieldParams
- Returns:
Authentication
-
registerFcmId
public BaseModel<RegistrationData> registerFcmId(AuthenticationFieldParams fieldParams, AuthenticationQueryParams queryParams)
Register a FCM ID to receive push notification- Parameters:
fieldParams
-AuthenticationFieldParams
queryParams
-AuthenticationQueryParams
- Returns:
BaseModel
-
deRegisterFcmId
public SuccessResponse deRegisterFcmId(AuthenticationFieldParams fieldParams, AuthenticationQueryParams queryParams)
-
changePassword
public void changePassword(AuthenticationQueryParams queryParams, AuthenticationFieldParams fieldParams, ListenerModel<BaseModel<java.lang.Object>,java.lang.Object> listener)
Reset a Password- Parameters:
queryParams
-AuthenticationQueryParams
fieldParams
-AuthenticationFieldParams
listener
- callback when change password is successful or not
-
updateProfile
public void updateProfile(AuthenticationQueryParams queryParams, AuthenticationFieldParams fieldParams, Listener<SuccessResponse> listener)
Update profile details- Parameters:
queryParams
-AuthenticationQueryParams
fieldParams
-AuthenticationFieldParams
listener
- listener if profile is successfully updated or not
-
resendEmailConfirmation
public void resendEmailConfirmation(AuthenticationFieldParams fieldParams, ListenerModel<BaseModel<Message>,Message> listener)
Resend the Email Confirmation- Parameters:
fieldParams
-AuthenticationFieldParams
listener
- callback when resend email is successful or not
-
revokeAccessToken
public void revokeAccessToken(AuthenticationFieldParams fieldParams, AuthenticationQueryParams queryParams, Listener<SuccessResponse> listener)
Revoke an access token- Parameters:
fieldParams
-AuthenticationFieldParams
queryParams
-AuthenticationQueryParams
listener
- callback when revoke access token is successful or not
-
requestPasswordReset
public void requestPasswordReset(AuthenticationFieldParams fieldParams, ListenerModel<BaseModel<Message>,Message> listener)
Request password reset. Remember to set theAuthenticationFieldParams.setClientId(String)
andAuthenticationFieldParams.setClientSecret(String)
and provide one of the following:AuthenticationFieldParams.setEmail(String)
,AuthenticationFieldParams.setEmailAlias(String)
(String)},AuthenticationFieldParams.setCardId(String)
(String)},- Parameters:
fieldParams
-AuthenticationFieldParams
listener
- callback when revoke access token is successful or not
-
resetPassword
public void resetPassword(AuthenticationFieldParams fieldParams, Listener<SuccessResponse> listener)
Reset password via secure token. Remember to set the following:- Parameters:
fieldParams
-AuthenticationFieldParams
listener
- callback when revoke access token is successful or not
-
-