Repository navigation
Replies: 1 comment 3 replies
|
This was suggested in the past in various forms (#5227, #3933, #2997, etc.) but there are no plans to change the tokens signing for now. I'm not entirely sure that I understand how do you plan to integrate with Pocket ID but please keep in mind that PocketBase JWTs are a little bit unorthodox because each user has a unique secret. Which usually would mean that it is not really feasible to validate a PocketBase token from an external application without sending a request because you'll have to somehow get access to the database to extract the user's specific tokenKey + the collection base secret for the token type in order to construct the full verification key. Side-note: if you are using Go and want to validate custom tokens, you don't have to use the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I've noticed that the
ParseJWTfunction (calledparseJWTin the JS VM) only supports the HS256 algorithm - https://github.com/pocketbase/pocketbase/blob/master/tools/security/jwt.go#L28.Have you perhaps ever considered extending that to some additional (asymmetric) algorithms?
The idea here is that one could use the
ParseJWTfunction to validate JWTs that came from the outside world and weren't produced by PocketBase, which signs them withHS256.Example: Let's say that I want to accept and validate tokens produced through the client credentials flow (grant) with something like Pocket ID, which doesn't (yet) support
HS256for signing tokens - https://pocket-id.org/docs/advanced/custom-keys.Note
I'll ask them (Pocket ID maintainers) as well if they're willing to include HS256 in the list of supported token signing algorithms.
Thank you!
All reactions