subhojit777 / questionnaire-backend

Real-time crowd survey application (Back-end)
http://subhojit777.in/questionnaire-backend/
MIT License
4 stars 2 forks source link

Research a way to cache GitHub access token #9

Closed subhojit777 closed 5 years ago

subhojit777 commented 5 years ago

Current GET /answers-get is using the access token to authenticate API calls. It is calling GET https://api.github.com/user with the token and returning output based on the response.

Repetitive calls to GET https://api.github.com/user is not possible, therefore find a way to cache the authentication, and invalidate it.

See #1

subhojit777 commented 5 years ago

Read https://auth0.com/docs/flows/concepts/regular-web-app-login-flow

subhojit777 commented 5 years ago

After reading https://auth0.com/docs/flows/concepts/regular-web-app-login-flow, decided that the current implementation of GET /answers-get is fine. It calls https://api.github.com/user with the access token to validate the request. In every API call which would require data from GitHub, the application should use the access token and validate it with https://api.github.com/user or something.