Replies: 2 comments
-
|
Thank you for showing this off! We are working on a much easier way of authentication that should land sometime soon, so this hopefully won't be necessary soon 😅 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks I had to double check that I was using an account with the proper permissions to manipulate pubs, otherwise the API properly would respond with 403 unauthorized access. Here is v6 Pubpub API documentation: Thanks 😄 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Wanted to share this in case someone else comes across this issue in the future. I'm using Python to call the API endpoints to automatically download pubs and came across this slightly confusing issue. The /api/login endpoint requires a hashed version of the password be passed in, which the documentation says is the SHA-3 hash. Unfortunately the SHA-3 function provided by the CryptoJS library that pubpub uses is not the current standard defined by NIST (see here). The CryptoJS docs acknowledge this but it's a little hard to find: https://cryptojs.gitbook.io/docs/
Anyway, the SHA-3 function in Python's hashlib library will not match the output of the CryptoJS SHA-3 function which will cause user authentication to fail. In order to fix this you have to use the keccak 512 bit hashing function. I used the pycryptodome library, and I'll also include my code here, hopefully it can help someone else :)
Beta Was this translation helpful? Give feedback.
All reactions