Reputation: 89
I'm having an issue with basic authentication using a Worklight adapter. Whenever I authenticate to a REST URL, it authenticates fine. However, the authentication seems to create a session within the Worklight server.
Example Call
function getTaskList(username,password) {
var input = {
method : 'post',
returnedContentType : 'json',
path : 'rest/url',
headers: {
'Authorization': 'Basic '+base64Encode(username+':'+password),
}
};
return WL.Server.invokeHttp(input);
}
Whenver I attempt to login from another device, Worklight server thinks I'm already signed in. Can you turn off session support in Worklight server or prevent caching? I want to authenticate every time to the REST URL. How is this possible?
Upvotes: 1
Views: 1220
Reputation: 3583
in the
<procedure>
element of the adapter XML file you should add connectAs="endUser"
. The connection to the back end will be created with the user's identity.
I am sorry, I did not understand your question.
In order to authenticate every time what you need to do is in the connectionPolicy
in the adapter XML file you need to change your cookiePolicy
Attribute to IGNORE_COOKIES
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType" cookiePolicy="IGNORE_COOKIES" maxRedirects="int"></connectionPolicy>
Upvotes: 2