I am trying to implement basic authentication in my Worklight project.
I set the following code in the adapter xml.
All my procedures have to have this basic authentication, so I set my procedures like this:
<procedure connectAs="server" name="getClass">
<description>Retrieves classdetails by id</description>
I get following error when I implement this:
FWLSE0101E: Caused by: [project Klappr]java.io.IOException: Unexpected character '<' on line 1, column 1
When I don't implement it, I get a 401 error, because no authentication object is given.
[11:26:43.403] "Transfer failed, errors = Runtime: Failed to parse JSON string
Error 401: An Authentication object was not found in the SecurityContext"
How can I mock this to username 'admin', password 'admin' instead of implementing the whole Worklight security before?
Info about the basic authentication :
Adapter is used for connecting to a backend. Using authentication in WL adapter means that your backend requires basic authentication.
You're getting error message because you've specified returnedContentType:"json" and your backend returns XML/HTML. Set returnedContentType to "plain" in order to see your backend response.