web-security

Ovi Stoica 2021-06-19T04:08:33.010300Z

Hello 👋! I am trying to modify how `buddy-auth` retrieves the token from a request in a JWS format authentication. Instead of  taking it from the `Authorization` header, I want to take it from request `cookie` named `token`  . From what I’ve dug, I assume I need to implement my own version of the protocol `IAuthentication` to have a different `-parse` function. I am pretty much a beginner with Clojure and what I don’t really understand is How is buddy going to use my version of the protocol instead of the default one? P.S Sorry  if this seems like obvious question Thank you

Ovi Stoica 2021-06-19T06:44:59.010500Z

I got it. The solution was to implement my own version of the jws-backend where I reified my own version of the protocol. Man I love clojure. In js I would’ve needed to fork the whole library and make this change 😄