RestAuth/General response codes

Aus Free Software
Zur Navigation springen Zur Suche springen

This page attempts to list response codes that are can always be returned and thus are skipped by individual method documentation. Each code gets its own section, the response body is given as well.

401

Returned when service authentication failed but it is possible to authenticate.

<service> is not allowed to authenticate from <ip-address>
The service is known to the system, but is not allowed to connect from the IP address that the request is coming from. You can either connect from a different host (find suitable hosts using restauth-service view <service>) or allow the service to connect from this host (try restauth-service set-hosts <service> <ip-address>).
please authenticate
This means that no initial authentication was provided.

403 Forbidden

Returned when service authentication failed and it is not possible (for this host) to authenticate. It is therefore useless for the host to repeat the request (i.e. using different credentials).

no service allowed to authenticate from <ip-address>
This means that no service is allowed to connect from the IP address you use. You can either connect from a different address or add a new service.

406 Not Acceptable

In general thrown when you requested a Content-Type that is unknown to RestAuth. Currently the only supported Content-Types are 'text/plain' and 'application/json'. This exception is only thrown when there actually is any content to return.

500 Internal Server Error

Unknown AUTH_PROVIDER
The AUTH_PROVIDER setting in localsettings.py is not 'internal' or 'apache'.
The webserver authenticated to a username that is unknown in the local database.
Indicates that the webserver already authenticated the service, but the username it used is unknown to RestAuth.

This status code is also the standard status code when RestAuth itself throws an exception that is not otherwise caught. If you encounter this, you should view this in your browser and file a bug-report.