Server side code running an authenticated API and a browser based client. In practice these will be two separate repositories. They are presented together here for convenience.
The flask app has resources that require auth.
- Authenticates user via oauth2
- Tracks logged in user via session
- Runs on localhost:5000
The Vue client has visualizations for the protected resources.
- Has callback route that handles talking to api callback endpoint.
- Displays logged in status
- Runs on localhost:8080
- Create project in Google Cloud Platform
- Configure Web application credentials
- Authorized JavaScript origins:
- Authorized redirect URIs:
- Download client_secret json, move to
client_secret.json
in flaskapp dir. - Create
client_config.js
containing client_id in vue_ui/src dir.
- Start flask app
- Start serving Vue app
- Open Vue app in browser
- Server side API has endpoints for both web server application flow and server-side flow.
- Browsing API uses web server application flow similar to existing work.
- Vue UI uses server-side flow by initiating auth and passing one-time code to API.