Labs/Weave/Identity/Account Manager/Spec/Latest: Difference between revisions

Line 201: Line 201:
;Response interpretation
;Response interpretation
* A 2xx response is a success, the user agent SHOULD save the ID and secret for future use, and it MUST execute the <tt>onsuccess</tt> status action, if present.
* A 2xx response is a success, the user agent SHOULD save the ID and secret for future use, and it MUST execute the <tt>onsuccess</tt> status action, if present.
* A 4xx response is a verification failure; the user agent SHOULD, if possible, attempt to address the problem and retry the query.  Note that the <tt>onfailure</tt> status action should ''not'' be executed in this case.
* A 4xx response is a verification failure; see the section '''Verification error handling''' below.  The user agent SHOULD, if possible, address the problem and retry the query.  Note that the <tt>onfailure</tt> status action should ''not'' be executed in this case.
* Any other response, or upon any verification failure that the user agent cannot correct, the user agent MUST execute the <tt>onfailure</tt> status action, if present.  Otherwise, it SHOULD reload the current page.
* Any other response, or upon any 4xx response that the user agent cannot correct, the user agent MUST execute the <tt>onfailure</tt> status action, if present.  If <tt>onfailure</tt> is not present, it SHOULD reload the current page.
 
Note that it is possible for the user agent to prompt the user after receiving a 4xx response.  In the event that the user cancels the operation, that shall be considered a failure and the user agent SHOULD execute the <tt>onfailure</tt> action.
 
===== Verification error handling =====
 
The server may reject an id/secret pair for a variety of reasons.  Upon failing to verify the id or secret, the server MUST return status code 400 in its response.  The body of the response MUST be a JSON-formatted object with at least one of the following properties:
 
* <tt>id-error:</tt> One of the literal strings <tt>"invalid-character", "over-max-length", "under-min-length", "id-already-in-use"</tt>
* <tt>secret-error:</tt> One of the literal strings <tt>"invalid-character", "over-max-length", "under-min-length"</tt>
 
For example:
 
{
  "id-error": "over-max-length",
  "secret-error": "invalid-character"
}


=== changepassword ===
=== changepassword ===
946

edits