Package org.forgerock.android.auth
Class FRSession
- java.lang.Object
-
- org.forgerock.android.auth.FRSession
-
public class FRSession extends java.lang.ObjectObject which represent the User Session
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidauthenticate(android.content.Context context, android.net.Uri resumeURI, NodeListener<FRSession> listener)Trigger the Authentication Tree flow process with the provided resume URIstatic voidauthenticate(android.content.Context context, java.lang.String serviceName, NodeListener<FRSession> listener)Trigger the Authentication Tree flow process with the provided tree namevoidauthenticate(android.content.Context context, PolicyAdvice advice, NodeListener<FRSession> listener)Trigger the Authentication Tree flow process with thePolicyAdvicestatic FRSessiongetCurrentSession()Retrieve the existing FRSession instance,java.util.Collection<java.lang.String>getSessionCookies()SSOTokengetSessionToken()Retrieve the stored Session Token.voidlogout()Logout the user
-
-
-
Method Detail
-
logout
public void logout()
Logout the user
-
getCurrentSession
public static FRSession getCurrentSession()
Retrieve the existing FRSession instance,If user session does not exist return null, otherwise return the existing User session, this cannot guarantee the existing user session is valid.
- Returns:
- The existing FRSession instance, or null if there is no user session.
-
getSessionToken
public SSOToken getSessionToken()
Retrieve the stored Session Token.- Returns:
- The Session Token
-
getSessionCookies
public java.util.Collection<java.lang.String> getSessionCookies()
-
authenticate
public void authenticate(android.content.Context context, PolicyAdvice advice, NodeListener<FRSession> listener)Trigger the Authentication Tree flow process with thePolicyAdvice- Parameters:
context- The Application Contextadvice- Policy Advice for Step up authentication.listener- Listener to listen for authenticate event.FRListener.onSuccess(Object)on success login,FRSessionis returned.NodeListener.onCallbackReceived(Node)step to the next node,Nodeis returned. throwswhen server returns {@link java.net.HttpURLConnection#HTTP_UNAUTHORIZED} throws {@link org.forgerock.android.auth.exception.ApiException} When server return errors. throws {@link javax.security.auth.callback.UnsupportedCallbackException} When {@link org.forgerock.android.auth.callback.Callback} returned from Server is not supported by the SDK. throws {@link org.forgerock.android.auth.exception.AuthenticationTimeoutException} When Authentication tree timeout throws {@link org.json.JSONException} when failed to parse server response as JSON String. throws {@link IOException } When there is any network error. throws {@link java.net.MalformedURLException} When failed to parse the URL for API request. throws {@link NoSuchMethodException} or {@link SecurityException} When failed to initialize the Callback class.
-
authenticate
public static void authenticate(android.content.Context context, java.lang.String serviceName, NodeListener<FRSession> listener)Trigger the Authentication Tree flow process with the provided tree name- Parameters:
context- The Application ContextserviceName- Authentication Tree namelistener- Listener to listen for authenticate event.FRListener.onSuccess(Object)on success login,FRSessionis returned.NodeListener.onCallbackReceived(Node)step to the next node,Nodeis returned. throwswhen server returns {@link java.net.HttpURLConnection#HTTP_UNAUTHORIZED} throws {@link org.forgerock.android.auth.exception.ApiException} When server return errors. throws {@link javax.security.auth.callback.UnsupportedCallbackException} When {@link org.forgerock.android.auth.callback.Callback} returned from Server is not supported by the SDK. throws {@link org.forgerock.android.auth.exception.AuthenticationTimeoutException} When Authentication tree timeout throws {@link org.json.JSONException} when failed to parse server response as JSON String. throws {@link IOException } When there is any network error. throws {@link java.net.MalformedURLException} When failed to parse the URL for API request. throws {@link NoSuchMethodException} or {@link SecurityException} When failed to initialize the Callback class.
-
authenticate
public static void authenticate(android.content.Context context, android.net.Uri resumeURI, NodeListener<FRSession> listener)Trigger the Authentication Tree flow process with the provided resume URI- Parameters:
context- The Application ContextresumeURI- Resume URIlistener- Listener to listen for authenticate event.FRListener.onSuccess(Object)on success login,FRSessionis returned.NodeListener.onCallbackReceived(Node)step to the next node,Nodeis returned. throwswhen server returns {@link java.net.HttpURLConnection#HTTP_UNAUTHORIZED} throws {@link org.forgerock.android.auth.exception.ApiException} When server return errors. throws {@link javax.security.auth.callback.UnsupportedCallbackException} When {@link org.forgerock.android.auth.callback.Callback} returned from Server is not supported by the SDK. throws {@link org.forgerock.android.auth.exception.SuspendedAuthSessionException} When Suspended ID timeout throws {@link org.forgerock.android.auth.exception.AuthenticationTimeoutException} When Authentication tree timeout throws {@link org.json.JSONException} when failed to parse server response as JSON String. throws {@link IOException } When there is any network error. throws {@link java.net.MalformedURLException} When failed to parse the URL for API request. throws {@link NoSuchMethodException} or {@link SecurityException} When failed to initialize the Callback class.
-
-