This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

How to build simple JWT structure?  RSS feed

 
Ranch Hand
Posts: 1611
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the example at jwt.io, and related Java Postings, which (confusingly) don't use the same example data, I'm not able to create the same hashed value they have on their page.

This is the code I"m working with from that page:



But it doesn't generate the same value as shown there.

For me, using the code above, I get: "eyJhbGciOiJIUzI1NiJ9.ewogICJzdWIiOiAiMTIzNDU2Nzg5MCIsCiAgIm5hbWUiOiAiSm9obiBEb2UiLAogICJhZG1pbiI6IHRydWUKfQ.9kg87S4P-lGhcSpT5r-sQfSyxgD5GhwmnN4LFZjw8uI"

It's not clear if I need to specify the header or exactly how to do it if needed.

The examples I've found suffer from snippet-only presentation, but not a full working simple-to-understand example.

Would appreciate any suggestions how to get the same hashed value as shown on jwt.io.

I'm sure I'm missing something basic...

Thanks,

- mike


 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!