dss_gke's People
dss_gke's Issues
How to secure JWT on client side
Ref: https://hasura.io/blog/best-practices-of-using-jwt-with-graphql/
1. Where to save JWT on client side
-
Local storage
This is prone to XSS attacks. -
Saving it in a cookie
Creating cookies on the client to save the JWT will also be prone to XSS. If it can be read on the client from Javascript outside of your app - it can be stolen. You might think an HttpOnly cookie (created by the server instead of the client) will help, but cookies are vulnerable to CSRF attacks. It is important to note that HttpOnly and sensible CORS policies cannot prevent CSRF form-submit attacks and using cookies require a proper CSRF mitigation strategy. -
In memory
It is still better option in comparing with 2 above options
2. Note solutions for Saving in memory option
-
Expiry time
Common practice is to keep it around 15 minutes. And refresh token when it get expired. -
Silent refresh
Recommend using this method.
Server need managing refresh token in their database.
Client need counting down and call refresh token before JWT get expired. -
Logout
Client: Delete JWT in memory
Server: Revoke and delete refresh token in database -
Logout for all devices
Client: Delete JWT in memory (could not delete JWT token in other devices, no way. But they will get expired soon)
Server: Revoke and delete all refresh tokens belong to the user.
optimize for for docker image
FROM alpine:latest
RUN apk --no-cache add ca-certificates
FROM google/cloud-sdk:alpine
FROM centos:7
RUN curl -sSL https://sdk.cloud.google.com | bash
ENV PATH $PATH:/root/google-cloud-sdk/bin
gke cluster auto scale to zero
cloudbuild with private repo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.