Based on the title you’re right, I asked about how to do X when probably I need to do Y, but the first and last paragraphs mention what’s my requirement: a for of authentication which doesn’t require to make an extra HTTP call to generate a token.
And what I mean by this is OAuth specifies the client needs to request an access token and an optional refresh token to the authorization server, afterwards the access token can be sent to the resource server (in this case my API), if the token expires the client can make another request to the authorization server with the refresh token.
Each call to the authorization server is that “extra http call” I mentioned.
Currently the only solution I found which seemed somewhat secure was WSSE, but again, I’ve only worked with OAuth2 and hashing passwords (or even better, using a dedicated service like keycloak), so I’m not sure what’s the best option to store the data it requires or if there’s a better solution.
I don’t know how to be more clear, is there a way to authenticate a client to the resource server (my API) without making the client call endpoints to generate the tokens? Is there a way for the client to generate their own tokens and for me to validate them?
JakenVeina@lemm.ee 1 year ago
Seconded. In particular:
Why? What qualifies as an “extra” HTTP call, and why does it matter?
pe1uca@lemmy.pe1uca.dev 1 year ago
Well, an “extra HTTP call” is any call besides the one required for the client to access my API, in this case is an extra call to generate an access token.
Why does it matter? In words of the client: “making a call to generate a token is slow”
paysrenttobirds@sh.itjust.works 1 year ago
The client is not always right. Make them define “slow” in concrete comparison to the rest of the things that happen in their product and once you have a reasonable number, I think it’s likely you can beat it.
pe1uca@lemmy.pe1uca.dev 1 year ago
Completely agree with you, I made that comment, but most people agreed with the client '-.-
JakenVeina@lemm.ee 1 year ago
Regardless, what’s the general architecture of this app? You’ve got an HTTP API, what else? How much is under your control, versus third parties?
pe1uca@lemmy.pe1uca.dev 1 year ago
I agree, the token has a lifespan of some hours so it could be generated after that amount of time, which for a ~400ms call is not that much, but I was overruled .-.
The only thing I control is the API, the client’s implementation is outside of my control (although I know is a backend service).
frezik@midwest.social 1 year ago
Are there a limited number of clients hitting the API? Would client side TLS certs be an option?