restauth-user

restauth-user manages users in RestAuth. Users are clients that want to authenticate with services that use RestAuth.

Note that restauth-user does not enforce restrictions on usernames as rigorously as the when handling users through the standard interface. Instead, only characters explicitly forbidden by the protocol specification are blocked. This way it is easy to handle users (about to be) imported from other systems.

Name of restauth-user

If you installed from source or with pip, the script is installed as restauth-user.py. If you installed RestAuth via your distributions package management system, the script is usually called restauth-user.

Usage

restauth-user [-h] {add,ls,rename,verify,set-password,rm,view} ...

Use one of the commands (either set-password, verify, list, add, rm or view) to perform the respective operation. Each command usually requires more arguments to it, see the respective section for arguments (and possible options) for each command.

Getting runtime help

To get an authoritative list of available commands, use:

restauth-user --help

If you want more information on a specific comannd, do:

restauth-user command --help

... or see the Available commands section below.

Examples

restauth-user add exampleuser
Add a user called exampleuser. Since neither --password nor --gen-password was specified, restauth-user will prompt for a password.
restauth-user add --gen-password exampleuser
Add a user called exampleuser, automatically generate a password and print it to stdout.
restauth-user view exampleuser
View all details of exampleuser.
restauth-user list
List all users known to RestAuth.
restauth-user verify --password=foobar exampleuser
Verify that exampleuser has the password foobar. restauth-user will exit with status code 0 if the password matches and 1 if not.
restauth-user set-password --gen-password exampleuser
Generate a new password for exampleuser.
restauth-user rm exampleuser
Remove exampleuser from RestAuth.

Available commands

The following subsections never document the ‘-h’ parameter for clarity.

add

add [-h] [--password PWD | --gen-password] user

Add a new user.

--password PWD

The password to use.

--gen-password

Generate a password and print it to stdout.

USER

The name of the user.

ls

ls [-h]
List all users.

rename

rename [-h] user NAME

Rename a user.

USER

The name of the user.

NAME

The new name for the user.

rm

rm [-h] user

Remove a user.

USER

The name of the user.

set-password

set-password [-h] [--password PWD | --gen-password] user

Set the password of a user.

--password PWD

The password to use.

--gen-password

Generate a password and print it to stdout.

USER

The name of the user.

verify

verify [-h] [--password PWD | --gen-password] user

Verify the password of a user.

--password PWD

The password to use.

--gen-password

Generate a password and print it to stdout.

USER

The name of the user.

view

view [-h] [--service SERVICE] user

View details of a user.

--service SERVICE

Act as if restauth-user was SERVICE.

USER

The name of the user.

Influential environment variables

DJANGO_SETTINGS_MODULE

The path to the Django settings module. If not set, RestAuth.settings is used, which should be fine in most cases. For more information, please read the Django documentation.

PYTHONPATH

A semi-colon (‘;’) seperated list of additional directories to search for python modules. The RestAuth installation must be in the module search path for any commands to work. For more information, please read the official python documentation.

Table Of Contents

Previous topic

restauth-service

Next topic

restauth-group

This Page