How to create registration token with otpkey paramter with REST API?


I want to create a registration token with with the REST API.

session_token = get_session_token()
headers["Authorization"] = session_token

response =
        "otpkey": "1234",
        "type": "registration",
        "user": "test",


But the API ignore the otpkey and returns other registration codes, e.g. like “rX5>j]=gSa;”“M>J~.t.5&z<”.

What do I wrong?

It looks like the registration token will always be generated by privacyIDEA.
it defaults to genkey=1.

However, you can have enrollment policies to define the length and the contents of the generated registration code.

Always take a look at the policies :wink:

1 Like