bottle-jwt icon indicating copy to clipboard operation
bottle-jwt copied to clipboard

How to add custom claims in JWT payload?

Open markusgraube opened this issue 7 years ago • 7 comments

bottle-jwt is really great :)

I would really like if I could add some custom payload to JWT. So that the client can have some extra information.

What about if the whole dict representing a user returned by authenticate_user of the AuthProvider would be used as JWT payload? Currently, only the field id of this dict is used. Or do I miss something?

markusgraube avatar Jul 03 '17 06:07 markusgraube

In your use case you need to have more user data encrypted within your token, so that a Javascript client that decrypts the token will have more information about request user. Am i getting it right?

PyB1l avatar Jul 03 '17 11:07 PyB1l

Yes, that is exactly what I meant.

markusgraube avatar Jul 03 '17 16:07 markusgraube

I 'm about to add your functionality within the week.

PyB1l avatar Jul 05 '17 12:07 PyB1l

Perfect. I can offer you some help, if you want

markusgraube avatar Jul 06 '17 19:07 markusgraube

is this function already on the library?

el-aro avatar Oct 18 '17 19:10 el-aro

I will merge your feature on Saturday , thanks for your patience.

PyB1l avatar Oct 19 '17 11:10 PyB1l

hey! im not sure if you had already merge that feature on the library. But if you still haven't i would not mind just asking, i'm lazy and i don't want to code something if the feature is already there. Thank you in advice.

el-aro avatar Jan 21 '18 20:01 el-aro