|
Spiffy UI Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RESTAuthProvider
This interface defines the necessary steps to perform a login for a REST service that follows the Novell architecture council standard for tokenized identity.
Field Summary |
---|
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 |
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. |
void |
login(java.lang.String username,
java.lang.String password,
java.lang.String authUrl,
RESTObjectCallBack<java.lang.String> callback)
Perform 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. |
Method Detail |
---|
void showLogin(RESTCallback callback, java.lang.String tokenServerUrl, java.lang.String code)
Show the login dialog.
This method is called when a REST call results in a 401 which requires login. The default implementation of this method shows a login dialog, but it could redirect to another page or simply show an error message.
callback
- the callback for the original REST calltokenServerUrl
- the URL for the authentication servercode
- the error codevoid finishRESTCall(java.lang.Object callBackKey)
Once the login is completed we need to perform the original REST request with the new user token.
This gives the framework a chance to repeat the request with the new token and have it complete successfully. This method is called after all of the login exchange is completed.
callBackKey
- the callback object of the original REST callvoid logout(RESTObjectCallBack<java.lang.String> callback)
Logout the current user.
This method clears all local variables, removes the session cookie, and issues the logout request to the server. The logout request to the server is typically a REST request made to the same URL as the login request but using an HTTP DELETE.
callback
- the REST callback to indicate the call is completedvoid login(java.lang.String username, java.lang.String password, java.lang.String authUrl, RESTObjectCallBack<java.lang.String> callback)
Perform login for the specified user credentials.
This method makes a REST request to the authentication server (through the authentication) proxy and gets the token based on the specified credentials.
username
- the usernamepassword
- the passwordauthUrl
- the URL of the authentication servercallback
- the REST callback for the original REST calljava.lang.String getServletContext()
|
Spiffy UI Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |