-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Is Storing Access_Token in Server-Side Cookies a Best Practice for API Validation? #463
Comments
@zuko-firelord yes u can also validate it using session_token, but make sure that cookie is present. |
@lakhansamani i couldnt find any function in authorizer-go related to validating APIs using the session_token. could you let me know the name of the function? |
i want to raise a PR for an example of authorizer-nextjs15 with middleware functionality and implement the backend authorize API. im not good at frontend stuff, but i'll give it a shot. Where should I push my code? |
@zuko-firelord thanks |
ive raised a pr...please cross-check that logics are correct, did it very short amt of time...pardon me for ui |
? |
@zuko-firelord there is API However this needs cookie and token cannot be passed in request and will return new session for security reasons. |
I am using Next.js 15 for the frontend and a Go backend. While reviewing the example of authorizer-nextjs, I noticed that the access_token is stored in a server-side cookie that can be use for validating API requests in middleware.
![image](https://private-user-images.githubusercontent.com/50701251/398012689-a3ada7d9-4851-40fe-9199-1ea661cf0d3b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDA4NjcsIm5iZiI6MTczOTIwMDU2NywicGF0aCI6Ii81MDcwMTI1MS8zOTgwMTI2ODktYTNhZGE3ZDktNDg1MS00MGZlLTkxOTktMWVhNjYxY2YwZDNiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE1MTYwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIxZmQ1MjY3NTkyZjk5YjMzMzczY2U4ZjI0OTliMDI3ZWY1YmQ1NTQ4YWNkNzE5ODhiOTcxODM2ZDMzNzU3YzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.2Z0rkq3KCds8zU4p4gJGtWJgOTviC0wkSAFAXCZi85E)
Is this approach secure and recommended?
If I decide not to store the access_token on server-side cookie, can I validate API requests using a session_token instead?
The text was updated successfully, but these errors were encountered: