Contents:
This API call validates user credentials.
Users can use either their username or e-mail address as the identity to validate against.
Certain parts of the CycleStreets API, such as addition of a photo, require correct user credentials to be supplied with those calls, and so they implement the same checks as this API call. This is a standalone method, that can be useful if the client UI has a specific screen for logging in a user.
Note that the validation status of the account will be checked (i.e. that the user has clicked on the link they were sent when creating the account, which confirms the validity of their e-mail address).
Security: As with the rest of the API, this method requires use of HTTPS.
(OpenID-based user authentication is not available or implemented at this time.)
Example which authenticates the user.
POST https://api.cyclestreets.net/v2/user.authenticate ( [identifier] => myusername [password] => mypassword1978 ) or ( [identifier] => user@example.com [password] => mypassword1978 )
Result:
{ "name": "Sam Smith", "email": "user@example.com", "username": "myusername", "privileges": [ ] }
This call requires a POST operation, to avoid us logging user credentials in the server logs.
None.
JSON object as above, showing the details of the user.
No cookie/session is created.
If the user has any special privileges, e.g. a feedback handler or OSM debugger, the privileges field will contain a comma-separated list of privileges, not in any specific order, e.g. osm,feedback
. The current special privileges, which are shown to the user in their profile page when they log in to the website, are currently as follows:
The privileges field always returns an array - either empty if no privileges, or a simple array of privilege identifer strings (as listed above) if the user has privileges.
JSON object containing an error key and a text string.
The error string from this method is suitable for passing directly on to the user.
Example errors (text string may vary):
{ "error": "No validated account matching that username and password was found." }
{ "error": "The account for the e-mail you specified has not yet been validated. Please check your e-mail account for the validation link you were sent." }