cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
284
Views
1
Helpful
3
Replies

SD-WAN -Not able to get the Session token using the API

malrabas
Cisco Employee
Cisco Employee

HI ,

I am trying to to get JSESSIONID i(authorization cookie) using CURL to access the API m using the below

 

curl -c - -X POST -k "https://sandbox-sdwan-2.cisco.com/" -H "Content-Type: application/json" -d '{
"j_username": "The username provided in the Sandbox guide ,
"j_password": "the password provided in the sandbox guide "
}' -c cookies.txt

getting this error

<div id="errorInfoText">
<span id="errorMessageBox" name="errorMessageBox" class="errorMessageBox"></span>
<span id="errorDetails" class="errorDetails">
<ul>
<li>If username and password are valid, user account is locked. Wait for some time and try again or contact Administrator</li>
<li>If username and password are valid, password has expired. Contact Administrator</li>
</ul>
</span>

 

please note  that login is sucessful when trying to access the sandbox  SD-WAN GUI  using same credential 

 

3 Replies 3

@malrabas try this. The following example shows requests for obtaining a token:

 

~ via  v3.11.(venv)
❯ curl --user devnetuser:RG\!_Yw919_83 https://sandbox-sdwan-2.cisco.com/dataservice/client/token --insecure
6E7B2862C8A0E8A88E213AB6136003D9E91285F6EEB1F46CEC2DD7E94C7F5856A6ADBF0076C0B634DF551315E0FFED4D292F

 

Also the Always On SD-WAN SBX is read only, and i think you can only perform GET requests. In your error you would also see - Access Forbidden for this user.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

divitgupta
Level 1
Level 1

@bigevilbeard  you rock!

Good morning . sorry for being later in reply and thanks a lot for the help in here.
That worked !
I also did further investigation and the below also worked fine

curl --location -g -k -i -C --request POST 'https://sandbox-sdwan-2.cisco.com/j_security_check' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'j_username=the user name r' --data-urlencode 'j_password="the password"'