Class FRUser
-
- All Implemented Interfaces:
public class FRUser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classFRUser.Browser
-
Method Summary
Modifier and Type Method Description static FRUsergetCurrentUser()Retrieve the existing FRUser instance, If user session does not exist return null, otherwise return the existing FRUser with the associated user session, this cannot guarantee the existing user session is valid. voidlogout()Logout the user voidrevokeAccessToken(FRListener<Void> listener)Revoke the AccessToken asynchronously, voidrefresh(FRListener<AccessToken> listener)Refresh the AccessToken asynchronously, force token refresh, no matter the stored AccessToken is expired or not refresh the token and persist it. voidgetAccessToken(FRListener<AccessToken> listener)Retrieve the AccessToken asynchronously, If the stored AccessToken is expired, auto refresh the token if refresh token is available. AccessTokengetAccessToken()Retrieve the AccessToken, if the stored AccessToken is expired, auto refresh the token it refresh token is available. voidgetUserInfo(FRListener<UserInfo> listener)Handles REST requests to the OpenId Connect userinfo endpoint for retrieving information about the user who granted the authorization for the token. static voidlogin(Context context, NodeListener<FRUser> listener)Trigger the user login process, the login service name is defined under string. static voidregister(Context context, NodeListener<FRUser> listener)Trigger the user registration process, the registration service name is defined under string. static FRUser.Browserbrowser()-
-
Method Detail
-
getCurrentUser
static FRUser getCurrentUser()
Retrieve the existing FRUser instance,
If user session does not exist return null, otherwise return the existing FRUser with the associated user session, this cannot guarantee the existing user session is valid.
-
logout
void logout()
Logout the user
-
revokeAccessToken
void revokeAccessToken(FRListener<Void> listener)
Revoke the AccessToken asynchronously,
- Parameters:
listener- Listener to listen for token revocation event.
-
refresh
@WorkerThread() void refresh(FRListener<AccessToken> listener)
Refresh the AccessToken asynchronously, force token refresh, no matter the stored AccessToken is expired or not refresh the token and persist it.
- Parameters:
listener- Listener to listen for refresh event.
-
getAccessToken
void getAccessToken(FRListener<AccessToken> listener)
Retrieve the AccessToken asynchronously,
If the stored AccessToken is expired, auto refresh the token if refresh token is available.
- Parameters:
listener- Listener to listen get Access Token event.
-
getAccessToken
@WorkerThread() AccessToken getAccessToken()
Retrieve the AccessToken, if the stored AccessToken is expired, auto refresh the token it refresh token is available.
-
getUserInfo
void getUserInfo(FRListener<UserInfo> listener)
Handles REST requests to the OpenId Connect userinfo endpoint for retrieving information about the user who granted the authorization for the token.
- Parameters:
listener- Listener to listen get UserInfo event.
-
login
static void login(Context context, NodeListener<FRUser> listener)
Trigger the user login process, the login service name is defined under string.xml file with forgerock_auth_service
- Parameters:
context- The Application Contextlistener- Listener to listen login event.
-
register
static void register(Context context, NodeListener<FRUser> listener)
Trigger the user registration process, the registration service name is defined under string.xml file with forgerock_registration_service
- Parameters:
context- The Application Contextlistener- Listener to listen register event.
-
browser
static FRUser.Browser browser()
-
-
-
-