Forum Discussion

aniciu's avatar
aniciu
Adept
7 years ago

How to call API to autenticate with HTAccess

I have a Lithium staging environment, and I want to start playing with the v1 API to insert some a messages. However I keep failing the authentication API.

 

Details:

1. When I login in the web interface, I first need to enter the HTAccess credentials, after which I can enter my own login credentials. I have an admin role for this Lithium instance.

2. When I try to programmatically call on the v1 API <commynity-host>/restapi/vc/authentication/sessions/login', it fails with 401 Unauthorized.

3. E.g.

curl -X POST -d 'user.login=myuser&user.password=mypass&restapi.response_format=json' 'https://12345678.stage.lithium.com/restapi/vc/authentication/sessions/login';

4. I tried to supply the call above the HTAccess credentials (instead of my own login and pw) and with the same result.

 

Any ideas?

 

thank you!

  • aniciu  Cross-check your credentials and try this one

    http://ht_username:ht_password@community_base_url/restapi/vc/authentication/sessions/login?user.login=ABC&user.password=XYZ

  • aniciu  Cross-check your credentials and try this one

    http://ht_username:ht_password@community_base_url/restapi/vc/authentication/sessions/login?user.login=ABC&user.password=XYZ