Setting PIN for papertoken with /token/init endpoint

Hello! I am very new to using Privacy Idea. I am having trouble when trying to create a paper token that has a PIN associated with it, using the /token/init endpoint. I’ve set up my Administrative API key and the token is created but no PIN is assigned to it. Here is a snippet of my code:

$params = array(
  'type' => 'paper',
  'user' => $identifier,
  'realm' => $privacyIdeaAuthenticator['realm'],
  'genkey' => '1',
  'otplen' => '8',
  'pin' => '1234'

$response = $Http->post("/token/init", $params, $this->requestCfg);

$this->requestCfg = array(
‘header’ => array(
‘Authorization’ => $srvr[‘HttpServer’][‘password’]

(Just testing the PIN, I won’t leave it at that value!)

Is there a policy I’m missing or something? I’m able to create a paper token with a PIN from the UI and it works as expected. I’m using version 3.3.3 on a Debian-based system with a postgres database.

Hard to say. We do not know your policies.
However, there is the policy enrollpin which allows users to set the pin during enrollment.

The WebUI uses the exact same API. So it is probably a matter of your configuration.

@cornelinux Thank you so much. After all that I think it was actually user error, not rebuilding an image on the other end. I appreciate your time and all your work on Privacy Idea.

1 Like