Skip to content

Custom Payload for the JWT tokens  #182

@futurbotconsolidated

Description

@futurbotconsolidated

Hi! @wagnerdelima, I have been using this lib from a long time now. I was implementing micro service architecture now but somehow I am facing dependency issues because of tokens I get. Since JWT Tokens are supposed to used everywhere to manage the user state but since we just get the following data

{items
"header":{
"alg":"HS256"
"typ":"JWT"
}
"payload":{
"token":"oJI1lNKgIV7ZboZ1H5jrFTBojO4uJh"
}
}

It is difficult to use the same authentication everywhere. Hence difficulty in using micro service architecture.

Proposed Solution :

  1. Able to manage the Secret which generate the JWT Token so we could handle authentication in any tech stack linked
  2. Able to add additional data in payload (ex: username, validity)

I am calling authentication API to check the token before handling request.

Screenshot 2023-04-30 at 20 57 22

I have also made a extra custom JWT token to pass with another API to manage this. Both approaches worked for me. But it would be amazing if I manage this this lib

I am more than happy to work on this if you think it is something we should brainstorm upon.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions