tymondesigns / jwt-auth

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

Refresh API returning iss which is different from the authenticate API #1944

Open prayphale opened 4 years ago

prayphale commented 4 years ago

Subject of the issue

I am using this library for authentication purposes. I am a newbie to this library. When I generate the token for the first time for authentication, I use customClaims to set iss value of my choice. But when I use the refresh call, I get the default instead of the value I set while first generating the token. I am not sure if this is actually a bug or I am missing something. I tried adding persistent_claims in the jwt config but it did not work.

Your environment

Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 5.x.y
Package version 0.5.12
PHP version 7.x.y

Steps to reproduce

1.) Authenticate using JWTFactory::make($customClaims) ---- $customClaims => ['iss' => 'XYZ'] 2.) Invoke the refresh API using JWTAuth::parseToken()->refresh(). 3.) The token obtained from the refresh() call has the default iss value (request URL) instead of the custom iss value I set when generating the token for the first time.

Expected behaviour

Should return the same iss value as the previous token

Actual behaviour

Returns the default iss value (request URL) instead of the previous token's iss value.

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.