Abiquo Documentation Cookies Policy

Our Documentation website uses cookies to improve your experience. Please visit our Cookie Policy page for more information about cookies and how we use them.


Abiquo 4.4

Skip to end of metadata
Go to start of metadata

Contents:

Login Resource

The login resource represents the current user and has methods to reset the user's password. 

Main URI of the Resource

This class operates mainly over the Resource URI: /login

Exposed Methods

Get the login information of the current user

Get the login information of the current user.

Synopsis: GET http://example.com/api/login
Roles Required: AUTHENTICATED
Request Headers: Accept: application/vnd.abiquo.user+json; version=4.4; application/vnd.abiquo.user+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity: User Media Type
Request Example:

 Click here to show or hide the request example

GET_login_AC_user_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/login \ 
	 -H 'Accept:application/vnd.abiquo.user+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "authType": "ABIQUO", 
  "surname": "4", 
  "name": "3", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/931", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "0"
    }, 
    {
      "href": "http://localhost:9009/api/admin/roles/614", 
      "type": "application/vnd.abiquo.role+json", 
      "rel": "role", 
      "title": "2"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/931/users/613", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "edit", 
      "title": "sysadmin"
    }, 
    {
      "href": "http://localhost:9009/api/admin/scopes/563", 
      "type": "application/vnd.abiquo.scope+json", 
      "rel": "scope", 
      "title": "Global scope"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/931/users/613/action/virtualmachines", 
      "type": "application/vnd.abiquo.virtualmachines+json", 
      "rel": "virtualmachines", 
      "title": "virtual machines"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/931/users/613/action/pendingtasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "pendingtasks", 
      "title": "pending tasks"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/931/users/613/applications", 
      "type": "application/vnd.abiquo.applications+json", 
      "rel": "applications", 
      "title": "applications"
    }
  ], 
  "locale": "5", 
  "email": "abc@example.com", 
  "nick": "sysadmin", 
  "firstLogin": false, 
  "active": true, 
  "locked": false, 
  "id": 613
}

 

Get authorization token to change password

Creates a token with userName and send an email with the link to reset the password. Set reset password to true

Synopsis: POST http://example.com/api/login/action/newpassword?user=userLogin
Roles Required: ANONYMOUS,AUTHENTICATED
Request Headers: 
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: 
Request Example:

 Click here to show or hide the request example

POST_login_act_newpsw_challenge_user.0001.txt

cURL:

curl -X POST http://localhost:9000/api/login/action/newpassword?challenge=undefined&user=sysadmin \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

Get the information of the current user example
$ curl -X POST http://example.com/api/login/action/newpassword?user=testUser  

 

Reset password

Updates user password. Set reset password to false and first_login flag to false.

UserName is taken from ResetPasswordToken.

Synopsis: POST http://example.com/api/login/action/reset?ResetPasswordToken=YToxMzg0NTA2MDUyNTQ0&newpassword=passwordTest
Roles Required: RESET_PASSWORD
Request Headers: 
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: 
Request Example:

 Click here to show or hide the request example

POST_login_act_reset_resetPwToken_newPw.0001.txt

cURL:

curl -X POST http://localhost:9000/api/login/action/reset?resetPasswordToken=c3lzYWRtaW46MTUxMjQ4NzMyODU4MA&newPassword=passwordTest728 \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

Get the information of the current user example
$ curl -X POST http://example.com/api/login/action/reset?ResetPasswordToken=YToxMzg0NTA2MDUyNTQ0&newpassword=passwordTest