How to use the indexedsecret with the REST API?

Hello,

I want to create indexedsecret tokens with the REST API.

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

response = requests.post(
    "{PRIVACYIDEA_URL}/token/init",
    headers=headers,
    data={
        "genkey": 1,
        "type": "indexedsecret",
        "user": "test",
        "realm": "ldaprealm",
    },
)

print(response.json())

This is the result

{"detail": {"otpkey": {"description": "OTP seed", "img": 
"data:image/png;base64,iV[...]CYII=", "value": 
"seed://00713e042d3"}, "serial": "PIIX0003CC7B", 
"threadid": 13968028}, "id": 1, "jsonrpc": "2.0", "result": {"status": 
true, "value": true}, "time": 1706264356.1969066, "version": "privacyIDEA 
3.9.2", "versionnumber": "3.9.2", "signature": 
"rsa_sha256_pss:9602e[...]1c"}

The images are QR Codes and not a index table. I am a little bit confused. Do I understand something wrong?

Also if I create a indexedsecret with the webui, I don’t get any image with the index table.

P.S.: I think it would be a good idea to add indexedsecret as optional tag.

Ok, I understand it now a litte bit more. You have the set your own otpkey and without genkey like:

response = requests.post(
    "{PRIVACYIDEA_URL}/token/init",
    headers=headers,
    data={
        "otpkey": "topsecretkey",
        "type": "indexedsecret",
        "user": "test",
        "realm": "ldaprealm",
    },
)

But I still think it would be nice, if you would get a table like

+---+---+---+---+---+---+---+---+---+----+----+----+
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
+---+---+---+---+---+---+---+---+---+----+----+----+
| T | O | P | S | E | C | R | E | T | K  | E  | Y  |
+---+---+---+---+---+---+---+---+---+----+----+----+

Thats right. You can either set an indexed secret or you can define to use an indexed secret from the user store.

Thank you for your respond very much!

But why do you offer a qr code instead of a pdf with a table like the tan list?