question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I add more to the payload?

See original GitHub issue

Hi! I need to add more things to the payload, for instance:

{
  aud: environmentId,
  sub: 'user-123',
  user: {
    email: 'joe.doe@example.com',
    name: 'Joe Doe'
  },
  auth: {
    'collaboration': {
      '*': {
        'role': 'writer'
      }
   }
}

How do I accomplish that? I’m only seeing options to add use claims and set a few other preconfigured properties, but not add new ones such as auth or aud in my example above.

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vimalloccommented, Feb 20, 2020

Yep! The commit is https://github.com/vimalloc/flask-jwt-extended/commit/bcb9459b94da80bd4abcc6f24f53787d6d030b3a and it’s on the 4.0.0-dev branch. I’m not sure how stable that branch is right now, things are still in flux, but I would love to have some people test it out and let me know if they run into any issues! 👍

0reactions
newarifrhcommented, Feb 21, 2020

Yep! The commit is bcb9459 and it’s on the 4.0.0-dev branch. I’m not sure how stable that branch is right now, things are still in flux, but I would love to have some people test it out and let me know if they run into any issues! 👍

Hi @vimalloc, thank you for making this useful extension.

I have a web service that uses flask_restplus & flask_jwt_extended. On the stable flask_jwt_extended version there are no constraints, but I need a claim that is at the root. And you explained that it would be in version 4.0.0-dev. Then I tried flask_restplus & flask_jwt_extended version 4.0.0-dev, but I have an error like this:

TypeError: wrapper() got an unexpected keyword argument 'username'

my code :

from flask import Flask
from flask_restplus import Resource, Api
from flask_jwt_extended import (
    JWTManager, jwt_required, get_jwt_claims
)

app = Flask(__name__)
app.config['JWT_SECRET_KEY'] = 'abc123!'
jwt = JWTManager(app)
api = Api(app)

class RecommendationUser(Resource):
@jwt_required
    def get(self, username, type_of_reference, limit):
        return get_jwt_claims()['email']

api.add_resource(RecommendationUser, '/User/Recommendation/<string:username>/<string:type_of_reference>/<int:limit>')

thank you

Hi, sorry about my problem 😅. I just found the get_raw_jwt() function which is to get all the payload data.

thank you 🙌

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Raise the Payload Rating of Your Truck
Subtracting the curb weight of the truck (8,000 pounds) from the GVWR (12,000 pounds) nets a figure of 4,000 pounds. This is the...
Read more >
How Can I Increase The Payload Of My Truck - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >
Payload Capacity: How Much Load Your Truck can Handle?
How to Increase Payload Capacity? · 1. Better rear springs · 2. Longer beds · 3. Extra bed racks · 4. Shock absorber...
Read more >
Calculating Your Truck's Maximum Payload and Towing ...
Discover more about towing capacity, payload and other ... These extras add weight to the vehicle, lowering the actual payload and towing ...
Read more >
I want to modify the original payload by adding more fields ...
To add the fields in the original payload, where are the extra fields coming from and in which format? Or You want to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found