New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The request needs to contain a valid PI-Authorization header. #2123
Comments
Thank you for filing an issue and sharing your observations or ideas. Please be sure to provide as many information as possible to help us working on this issue. |
We do not real OAuth, so you need to pass the Authorization header a bit different: curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: $tkn',
'Content-Length: ' . strlen($data_string))
); Since in certain cases there can be clashes with other Authorization headers, we also parse for our own header and you can do it this way: curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'PI-Authorization: $tkn',
'Content-Length: ' . strlen($data_string))
); |
Thank you. Is it possible to get, with an API, the OTP code sends to user by the triggerchallenge above? Carlo |
I GET the same error..... Screen: object(stdClass)[1] object(stdClass)[4] |
Then you are probably doing another mistake. For questions how to use privacyIDEA and concepts (your 2nd one) please got to https://community.privacyidea.org |
@cartenca You may want to take a look at the implementation of our simpleSAMLphp module, which also uses the trigger challenge or at our ownCloud Plugin. Thus you can see how we did it in PHP. I closed this issue, because it is not an issue with privacyIDEA. |
I'm using PHP cURL API request to "GET /validate/triggerchallenge".
In your API documentation It is written that "The request needs to contain a valid PI-Authorization header."
What does it mean?
I use this php code
TO RETRIVE TOKEN (and this is correct and it works):
TO PERFOM triggerchallenge:
but I receive : 'Authentication failure. Error during decoding your token: Not enough segments'
Could you help me please?
One more thing....
Is it possible to retrive, with an API, the OTP code sends to user by the triggerchallenge above?
I have to use the OTP code to encrypt a file so that the user can decrypt it with the same OTP code sent to him by privacyidea.
Thank you very much!
Carlo
The text was updated successfully, but these errors were encountered: