LoginResource


Login and get the current user


Authenticate in the Abiquo API and return the current user with their credentials, if any.

GET https://example.com/api/login

Roles : [ROLE_AUTHENTICATED]

Parameter Type Default Value Description
expand String The node to expand. Possible parameters are [privileges: retrieve flat privileges]

Accept : user

Example

Request authorization token to reset user password


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

Verify ReCaptcha if the challenge is sent.

POST https://example.com/api/login/action/newpassword

Roles : [ROLE_ANONYMOUS, ROLE_AUTHENTICATED]

Parameter Type Default Value Description
response String ReCAPTCHA response field
user String Login user

Example

Reset user password


Updates a user password. Set reset password to false and first_login flag to false.
UserName is taken from ResetPasswordToken.

POST https://example.com/api/login/action/reset

Roles : [ROLE_RESET_PASSWORD]

Parameter Type Default Value Description
newPassword String The new desired password
resetPasswordToken String Token obtained from ''request authorization token to reset user password''

Example

List active sessions


Retrieves active sessions in the API.

GET https://example.com/api/login/sessions

Roles : [ROLE_AUTHENTICATED]

Accept : sessions

Example

Delete all user sessions


Delete (close) all sessions for a user.

DELETE https://example.com/api/login/sessions/users/{user}

Roles : [ROLE_AUTHENTICATED]

Example

List active sessions for a given session key


List all active sessions for the given key. Because sessions are opened in the UI application, the session key will be managed by the browser. If the browser reuses (for example) the same session key between different tabs, there will be multiple sessions (and maybe different users) with the same session key.

GET https://example.com/api/login/sessions/{session}

Roles : [ROLE_AUTHENTICATED]

Accept : sessions

Example

Delete a session from an user


Delete (close) a session for a user

DELETE https://example.com/api/login/sessions/{session}/{user}

Roles : [ROLE_AUTHENTICATED]

Example

Get the session for an user


Get the session information for the given user.

GET https://example.com/api/login/sessions/{session}/{user}

Roles : [ROLE_AUTHENTICATED]

Accept : session

Error Codes

  • USER-15 - The supplied session does not exist
  • USER-3 - The requested user does not exist

Example