Is there a way to add custom field to payload ?
See original GitHub issueHi all .
I want to add a custom field(UserType) to my jwt payload. look like that , how can i do that ?
String compactJws = Jwts.builder()
.setId(uid)
.setCustomField("userType",userType)
.setExpiration(getExp())
.signWith(SignatureAlgorithm.HS512,key)
.compact();
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to add custom field in webhook custom payload - Alerts
new relic how to add custom violation description in webhook custom payload.
Read more >How to add additional custom field in streaming event payload?
You can derive it from your subscriber's connection. For some events, you can also use LoginUrl and/or NetworkId . – identigral. May 21...
Read more >How to include custom field values in Webhook custom payload
Solved: Hi there We have a requirement to pass custom field values to an external application and our plan is to use the...
Read more >How to add custom fields to WooCommerce webhooks?
In this post, I described how you can add custom fields to they $payload object by using the woocommerce_webhook_payload hook. You can use...
Read more >Updating custom fields' values - Getting started
With the. PUT request, you need to pass along the key (field API key) as a parameter and add a new value to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bakulinav You can have a custom class like:
and use this class like:
now you can call:
I’d really recommend not subclassing the Claims implementation - you’re tightly coupling your implementation to JJWT’s. Instead, it’s better to use composition over inheritance. In other words, save your custom data as a claim, e.g.
.claim("foo", myData)
. Once you acquire your custom data, you can convert it or inspect it however you wish.