AuthenticationResource login endpoint throwing 400 code

20 views
Skip to first unread message

sethgr...@gmail.com

unread,
Jul 13, 2017, 5:51:44 PM7/13/17
to scmmanager
Documentation doesn't show an example of a post body but below is a sample post from fiddler I used for testing. I also tested by posting with query string params (though documentation states these should be forms). I tried with both simple user and ldap (ActiveDirectory) account credentials and I get 400 code back from both. I'm attempting to use this method to confirm a user's credentials will work. Other api methods work just fine when provided basic auth headers.  


POST https://sc.enviance.com/scm/api/rest/authentication/login HTTP/1.1

User-Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.14393.1358

Content-Type: application/json

Host: sc.enviance.com

Content-Length: 60

Connection: Keep-Alive

 

{

"username": "user",

"password": "pass"

}


Response:

HTTP/1.1 400 Bad Request


Content-Length: 0


Server: Jetty(7.6.16.v20140903)


sethgr...@gmail.com

unread,
Jul 13, 2017, 6:13:04 PM7/13/17
to scmmanager
Apologies - I guess it really is a forms post, and not json post. Found it by tracing UI.

Changing the request to post just field names resulted in 200 (or 401 if wrong credentials).

 "username=user&password=password2"

Reply all
Reply to author
Forward
0 new messages