In an API I have there's a requirement to use an authentication method other than OAuth2 or any kind of token generation which requires making an extra HTTP call.

With this in mind there's this https://www.xml.com/pub/a/2003/12/17/dive.html
I've only stored passwords as hashes and used functions like password_verify to know the user sent the proper credentials without actually knowing the password stored in DB.
WSSE requires to encrypt with SHA1 the credentials being sent, which means the API needs to retrieve the password in plain text to recreate the digest and compare it to the one sent by the user.
So, how should I be storing this password if the code needs it to recreate the hash?
Should I have something like a master password and store them encrypted instead of hashed?


Most of the information I've found about WSSE is very very old, and some implementations have it marked as deprecated, do you know any other type of standard authentication where the user can generate the token instead of having to make an extra HTTP call?

  • noli@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Couldn't you do something like JWT except allow the client to slap on their credentials to any initial request?

    From the backend side that means that if there is no valid token, you can check the request body for the credentials. If they're not there, then it's an unauthorized request.

    You're eliminating a singular request in a long period of time at the cost of adding complexity to both client and backend but if the customer wants to be silly that's their fault