|
Oracle© Collaboration Suite Workspaces Web Services API Reference 10g Release 1 (10.1.2.2) Part No. B28209-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
AuthenticationService provides an authentication mechanism for users to access Collaborative Workspaces Web Services.
The user supplies his login credentials. The web service validates the same by connecting to the Oracle Internet Directory. An authentication cookie representing the user session is returned. This cookie is passed to all other Web services for invoking them. Until the time that the cookie expires or the user explicitly logs out, he will not be required to supply his credentials while making web service requests.
The code snippet given below, for an Axis client, explains how a user can authenticate himself and use the cookie within remaining Web services. Other web service clients would need to set up the cookie in a similar fashion.
//Instantiate the locator. The locator points to the web service end point. AuthenticationServiceServiceLocator assl = new AuthenticationServiceServiceLocator(); //Get a handle to the actual service. AuthenticationService as = assl.getAuthenticationService(); //Indicate to the server that the client is willing to maintain the session ((AuthenticationServiceSoapBindingStub)as).setMaintainSession(true); // Invoke login method as.login("scott","tiger"); //Extract the cookie set if the user is successfully authenticated. String cookie = (String)((AuthenticationServiceSoapBindingStub)as)._getCall().getMessageContext().getProperty(HTTPConstants.HEADER_COOKIE); //Invoke an instance of the home service locator. HomeServiceServiceLocator hssl = new HomeServiceServiceLocator(); //Get a handle to the home service HomeService hs = hssl.getHomeService(); //Indicate to the server to maintain the session ((HomeServiceSoapBindingStub)hs).setMaintainSession(true); //Set the cookie retrieved in the previous operation. ((javax.xml.rpc.Stub)hs)._setProperty(HTTPConstants.HEADER_COOKIE,cookie);
Method Summary | |
void |
login(java.lang.String userName, java.lang.String passwd) Logs in the user, if he is a valid user and sets a session cookie into user's HTTP session. |
void |
logout() Closes the user's HTTP session and cleans up all the objects in the HTTP session. |
Method Detail |
public void login(java.lang.String userName, java.lang.String passwd) throws CwWSException
userName
- - user's nick namepasswd
- - password. Both username and passwd are in clear text.CwWSException
- - If the login failspublic void logout() throws CwWSException
CwWSException
- - If logout fails
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |