tymondesigns / jwt-auth

🔐 JSON Web Token Authentication for Laravel & Lumen
https://jwt-auth.com
MIT License
11.29k stars 1.54k forks source link

Get secret key based on issuer #1776

Open zagreusinoz opened 5 years ago

zagreusinoz commented 5 years ago

Subject of the issue

I want to be able to assign tokens based on the iss claim. I'm using that to indicate a users' team. I see in #503 that I can set the secret with JWTAuth::getJWTProvider()->setSecret('foobarbaz');, however it's not clear to me where I can set that in the auth lifecycle so that the token is already parsed and I can retrieve the team model to get the secret key.

Has anyone implemented or does anyone have any suggestions? I'd rather not create a new User Provider...

Thanks in advance for any help.

philbenoit-ibsa commented 5 years ago

@zagreusinoz Are you trying to get the users team when they complete other secure actions on the API? Is it not possible to set this within a custom claim on the model and then retrieve with the payload call?

https://jwt-auth.readthedocs.io/en/develop/auth-guard/#payload

stale[bot] commented 3 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.