RestAuth: Unterschied zwischen den Versionen

Aus Free Software
Zur Navigation springen Zur Suche springen
(first version)
(Weiterleitung auf Https:// erstellt)
(35 dazwischenliegende Versionen von 3 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
== Documentation ==
=== Terminology ===
Essentially, when dealing with shared authentication, you have to deal with ''two'' types of accounts:
# Users that want to authenticate themselves against some service
# The service that wants to use the shared authentication
In the following documentation, we refer to (1) as '''ServiceUser''' and (2) to '''Service'''.
=== Create a ServiceUser ===
In order to create a ServiceUser, perform an HTTP request to:
POST /users/
The POST data MUST contain two values:
; username : The name of the user to create
; password : The password for this user
This method returns the following status codes:
; 201 Created : If the creation of the user succeeded
; 400 Bad Request : If either the POST data did not contain a username ''and'' password or if either username or password is not acceptable to the system.
; 405 Method Not Allowed : If the request to /users/ was not a POST request
; 409 Conflict : If the user already exists
; 500 Internal Server Error : If any other problem occurs
To create a user with curl, do:
curl -X POST -w "%{http_code}\n" -d "username=myuser&password=mypassword" http://user:pass@localhost:8000/users/
=== Update a ServiceUser ===
To update the credentials of a ServiceUser, perform an HTTP request to:
PUT /users/<username>
where "<username>" is the name of the user to update.
The request data is interpreted the same way as with a POST request. It must contain either username and/or password. The service may not allow to update the username itself (see status codes below).
This method returns the following status codes:
; 200 OK : If the credentials where successfully updated
; 400 Bad Request : If the request data could not be parsed or if the new username/password is not acceptable to the system.
; 403 Forbidden : If the Service attempts to change the username and the RestAuth instance does not allow such a change.
; 404 Not Found : If the username does not exist

Aktuelle Version vom 10. September 2011, 18:28 Uhr

Weiterleitung nach: