14.1.1.17. Register endpoints

This module contains the REST API for registering as a new user. This endpoint can be used without any authentication, since a new user can register.

The methods are tested in the file tests/test_api_register.py

GET /register

This endpoint returns the information if registration is allowed or not. This is used by the UI to either display the registration button or not.

Return

JSON with value=True or value=False

POST /register

Register a new user in the realm/userresolver. To do so, the user resolver must be writeable like an SQLResolver.

Registering a user in fact creates a new user and also creates the first token for the user. The following values are needed to register the user:

  • username (mandatory)

  • givenname (mandatory)

  • surname (mandatory)

  • email address (mandatory)

  • password (mandatory)

  • mobile phone (optional)

  • telephone (optional)

The user receives a registration token via email to be able to login with his self chosen password and the registration token.

JSON Parameters
  • username – The login name of the new user. Check if it already exists

  • givenname – The givenname of the new user

  • surname – The surname of the new user

  • email – The email address of the new user

  • password – The password of the new user. This is the resolver password of the new user.

  • mobile – The mobile phone number

  • phone – The phone number (land line) of the new user

Return

a json result with a boolean “result”: true