I want to use REST api with curl and reset current login failed attempt to 0 when it turns to non zero digit..i am new to REST api can anybody help me with this.
Hi @[deleted] ,
Is there any particular reason for resetting failed login attempts? If the user that is experiencing issues with log in provides the correct credentials, this should reset the counter, therefore the user should log in.
There is not REST API available to reset failed login count. Instead, you would have to mimic the web request, providing a token/session to the request and bypass websudo. Here is an example for Jira:
Create a new session for a Jira user:
# replace ADMIN_USERNAME and ADMIN_PASSWORD to authenticate against Jira
# replace http://localhost:8080, with Jira's Base URL
curl -k -v \
-H 'Content-type: application/json' \
-d '{"username": "ADMIN_USERNAME","password": "ADMIN_PASSWORD"}' \
-X POST http://localhost:8080/rest/auth/1/session
As a response, you should expect:
{"session":{"name":"JSESSIONID","value":"D5DB341DC48BDBE65582086BBFCEF65F"},"loginInfo"....
Consuming the response from above, run the following Web Request
# replace ADMIN_USERNAME, with a Jira administrator
# replace D5DB341DC48BDBE65582086BBFCEF65F, with JSESSION retrieved from previous endpoint
# replace http://localhost:8080, with Jira's Base URL
# replace USERNAME, with user that reset current login failed
curl -k -v -u ADMIN_USERNAME \
-H "X-Atlassian-Token: no-check" \
-b "JSESSIONID=D5DB341DC48BDBE65582086BBFCEF65F;" \
-X GET http://localhost:8080/secure/admin/user/ResetFailedLoginCount.jspa?name=USERNAME
The above shall give you a HTTP/1.1 302 as HTTP response header, resetting failed login attempts.
Kind regards,
Rafael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.