Could you share more details about the challenge and the context you’re working in?
Which API are you accessing, and where are you accessing it from, or what feature are you building?
For example, if you just need this information to call an API via Postman, you could use the VTEX IO CLI itself to grab the token and use it in the header of a private request.
vtex local token
Prints the user auth token and copies it to the clipboard.
If you’re building a custom app, the recommended approach would be to use the clients provided by VTEX itself…
In other words, it depends on what you’re developing.
Feel free to share more details about your challenge.
Hope you’re doing well!
I implemented the OAuth2 system, where customers log in to our database and we perform the necessary validations. During this process, we generate a JWT token for VTEX, which they use to complete the OAuth2 flow on their end. However, I now need that token, as we’re making changes to the Home Page in IO and need to use it to access our internal APIs.
For example, on the Home page, we’ll display data from our system, such as the customer ID, monthly score, and other information. I’d like to reuse the same JWT token, avoiding the need to perform a new internal login just to generate another token solely to access this data.