Authentication problem trying to POST statement

247 views
Skip to first unread message

gva...@gmail.com

unread,
Jan 26, 2015, 11:11:48 PM1/26/15
to learnin...@googlegroups.com
I've installed LearningLocker and now using Firefox's POSTER addon to test the REST calls to it.

Calling http://mytest.com/data/xAPI/about (mytest.com is an internal URL we use) gives me correct response of:

{"X-Experience-API-Version":"1.0.1","version":["1.0.1"]}

(this /about call doesn't require authentication)

But now when trying to push a statement into the LRS, it requires authentication:
- Logging into LRS I obtain the UserName + Password on the "xAPI statements" settings page (lrs/54c194bb6446427c158b4567/endpoint )
- I use these credentials in the "User Auth" inputs in Poster (Please see screenshot)
- No values in "Headers" & Parameters tabs

Now I get response:
{"error":true,"message":"Unauthorized request."}

http://postimg.org/image/6gj8da3j7/

Some info about VirtualHost entry here:
http://docs.learninglocker.net/statements/
but putting that line into the VirtualHosts entry on apache site config file and POSTing the same data returns new error:

{"error":true,"message":["`auth` is not a valid string with base64 contents in headers. "]}

Any help would be greatly appreciated,

Many thanks
Gert

Ryan Smith

unread,
Jan 27, 2015, 11:51:00 AM1/27/15
to learnin...@googlegroups.com, gva...@gmail.com
My guess is that Poster doesn't add the Authorization header correctly. Can you ensure that the Authorization header is set to "Basic " followed by a base 64 string that when decoded returns username:password (in that format - with the colon between).

gva...@gmail.com

unread,
Jan 27, 2015, 6:01:10 PM1/27/15
to learnin...@googlegroups.com, gva...@gmail.com
Thanks Ryan that seemed to worked.

Ryan Smith

unread,
Jan 29, 2015, 4:58:40 AM1/29/15
to learnin...@googlegroups.com, gva...@gmail.com
You're welcome.
Reply all
Reply to author
Forward
0 new messages