|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.spiffyui.client.rest.AuthUtil
public class AuthUtil
This is the default class for handling authentication during REST calls.
The default authentication handler follows the Novell standards for REST authentication. This class implements that handler. You can override this class and create your own authentication handler to satisfy any authentication scheme your application may require.
Field Summary | |
---|---|
protected static LoginStringHelper |
HELPER
The string helper for providing strings to the login dialog |
Fields inherited from interface org.spiffyui.client.rest.util.RESTAuthConstants |
---|
AUTH_LOGOUT_URL_TOKEN, AUTH_URL_TOKEN, GONE, INVALID_AUTH_HEADER, INVALID_INPUT, INVALID_JSON, INVALID_LOGIN_REQUEST, INVALID_LOGOUT_REQUEST, INVALID_TS_URL, MULTIPLE_ACCOUNTS, NO_PRIVILEGE, NOTFOUND_TS_URL, PASSWORD_TOKEN, USER_TOKEN, USERNAME_TOKEN |
Constructor Summary | |
---|---|
AuthUtil()
Create a new AuthUtil |
Method Summary | |
---|---|
void |
finishRESTCall(java.lang.Object callBackKey)
Once the login is completed we need to perform the original REST request with the new user token. |
java.lang.String |
getServletContext()
Gets the servlet context from the current URL. |
protected LoginStringHelper |
getStringHelper()
Provide the LoginStringHelper class for use with the login panel. |
void |
login(java.lang.String username,
java.lang.String password,
java.lang.String authUrl,
RESTObjectCallBack<java.lang.String> callback)
Performs login for the specified user credentials. |
void |
logout(RESTObjectCallBack<java.lang.String> callback)
Logout the current user. |
void |
showLogin(RESTCallback callback,
java.lang.String tokenServerUrl,
java.lang.String code)
Show the login dialog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final LoginStringHelper HELPER
Constructor Detail |
---|
public AuthUtil()
Method Detail |
---|
public void showLogin(RESTCallback callback, java.lang.String tokenServerUrl, java.lang.String code)
showLogin
in interface RESTAuthProvider
callback
- the callback for the original REST calltokenServerUrl
- the URL for the authentication servercode
- the error codeprotected LoginStringHelper getStringHelper()
public void finishRESTCall(java.lang.Object callBackKey)
finishRESTCall
in interface RESTAuthProvider
callBackKey
- the callback object of the original REST callpublic void logout(RESTObjectCallBack<java.lang.String> callback)
logout
in interface RESTAuthProvider
callback
- the REST callback to indicate the call is completedpublic void login(java.lang.String username, java.lang.String password, java.lang.String authUrl, RESTObjectCallBack<java.lang.String> callback)
login
in interface RESTAuthProvider
username
- the usernamepassword
- the passwordauthUrl
- the URL of the authentication servercallback
- the REST callback for the original REST callpublic java.lang.String getServletContext()
getServletContext
in interface RESTAuthProvider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |