Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kujo's avatar
Level 1

API authentication with Passport

Hi,

I have an API set up using Passport for authentication and all works great the vast majority of times, but when I deploy an update (I'm using AWS Beanstalk), any authenticated client is kicked out basically and all their requests become 401s.

Is there something I'm doing wrong that is stopping me from doing a deployment with Passport and retain the existing sessions?

0 likes
3 replies
martinbean's avatar

@kujo What are you doing when deploying to Beanstalk? The only thing I can think of is if you’re rotating your APP_KEY, which will then invalidate existing tokens because the app won’t be able to decrypt them any more.

kujo's avatar
Level 1

I have the App Key stored in a secure environment variable that is set during the deployment. does this need to be set in the .env? If one isn't set, would it generate a new one?

kujo's avatar
Level 1

To clarify, its in the AWS Parameter store, that is added the the .env file during the deployment stage, so it should be there as far as I know?

Please or to participate in this conversation.