Security

These endpoints will allow you to easily manage password.

Change logged user password

To change logged user password you will need to call the /api/admin/password/change endpoint with the POST method.

Definition

POST /api/admin/password/change
Parameter Parameter type Description
Authorization header Token received during authentication
currentPassword query Current password
plainPassword query New password

Example

curl http://localhost:8181/api/admin/password/change \
    -X "POST" \
    -H "Accept: application/json" \
    -H "Content-type: application/x-www-form-urlencoded" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6..." \
    -d "currentPassword=example123!@#" \
    -d "plainPassword=example321!@#"

Note

The eyJhbGciOiJSUzI1NiIsInR5cCI6… authorization token is an exemplary value. Your value can be different. Read more about Authorization in the.

Note

Your password must be at least 8 characters long. Your password must include both upper and lower case letters. Your password must include at least one number. Your password must contain at least one special character.

Exemplary Response

STATUS: 200 OK
{
  "success": true
}

Change logged user password (customer)

To change logged customer password you will need to call the /api/customer/password/change endpoint with the POST method.

Definition

POST /api/customer/password/change
Parameter Parameter type Description
Authorization header Token received during authentication
currentPassword query Current password
plainPassword query New password

Example

curl http://localhost:8181/api/customer/password/change \
    -X "POST" \
    -H "Accept: application/json" \
    -H "Content-type: application/x-www-form-urlencoded" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6..." \
    -d "currentPassword=example123!@#" \
    -d "plainPassword=example321!@#"

Note

The eyJhbGciOiJSUzI1NiIsInR5cCI6… authorization token is an exemplary value. Your value can be different. Read more about Authorization in the.

Note

Your password must be at least 8 characters long. Your password must include both upper and lower case letters. Your password must include at least one number. Your password must contain at least one special character.

Exemplary Response

STATUS: 200 OK
{
  "success": true
}

Change logged user password (seller)

To change logged seller password you will need to call the /api/seller/password/change endpoint with the POST method.

Definition

POST /api/seller/password/change
Parameter Parameter type Description
Authorization header Token received during authentication
currentPassword query Current password
plainPassword query New password

Example

curl http://localhost:8181/api/seller/password/change \
    -X "POST" \
    -H "Accept: application/json" \
    -H "Content-type: application/x-www-form-urlencoded" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6..." \
    -d "currentPassword=example123!@#" \
    -d "plainPassword=example321!@#"

Note

The eyJhbGciOiJSUzI1NiIsInR5cCI6… authorization token is an exemplary value. Your value can be different. Read more about Authorization in the.

Note

Your password must be at least 8 characters long. Your password must include both upper and lower case letters. Your password must include at least one number. Your password must contain at least one special character.

Exemplary Response

STATUS: 200 OK
{
  "success": true
}

Set new password after reset password requesting

To reset logged user password you will need to call the /api/password/reset endpoint with the POST method.

Definition

POST /api/password/reset
Parameter Parameter type Description
Authorization header Token received during authentication
token query Token received during resetting the password
reset[plainPassword] query New password

Example

curl http://localhost:8181/api/password/reset \
    -X "POST" \
    -H "Accept: application/json" \
    -H "Content-type: application/x-www-form-urlencoded" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6..." \
    -d "reset[plainPassword]=example123!@#" \
    -d "token=AIENe11JjR2kj3XGiWuZmQ88gZYAgM7VR5inxtbswaY"

Note

The eyJhbGciOiJSUzI1NiIsInR5cCI6… or AIENe11JjR2kj3XGiWuZmQ8… authorization token are an exemplary value. Your value can be different. Read more about Authorization in the.

Note

Your password must be at least 8 characters long. Your password must include both upper and lower case letters. Your password must include at least one number. Your password must contain at least one special character.

Exemplary Response

STATUS: 200 OK
{
  "success": true
}

“Forgot password” functionality

To provide “Forgot password” functionality you will need to call the /api/password/reset/request endpoint with the POST method.

Definition

POST /api/password/reset/request
Parameter Parameter type Description
Authorization header Token received during authentication
username query User name who recovers the password

Example

curl http://localhost:8181/api/password/reset/request \
    -X "POST" \
    -H "Accept: application/json" \
    -H "Content-type: application/x-www-form-urlencoded" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6..." \
    -d "username=admin"

Note

The eyJhbGciOiJSUzI1NiIsInR5cCI6… authorization token is an exemplary value. Your value can be different. Read more about Authorization in the.

Exemplary Response

STATUS: 200 OK
{
  "success": true
}

Log out current user

To log out current user you will need to call the /api/token/revoke endpoint with the GET method.

Definition

GET /api/token/revoke
Parameter Parameter type Description
Authorization header Token received during authentication

Example

curl http://localhost:8181/api/token/revoke \
    -X "GET" \
    -H "Accept: application/json" \
    -H "Content-type: application/x-www-form-urlencoded" \
    -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6..."

Note

The eyJhbGciOiJSUzI1NiIsInR5cCI6… authorization token is an exemplary value. Your value can be different. Read more about Authorization in the.

Exemplary Response

STATUS: 200 OK
[]