quartz-frontend icon indicating copy to clipboard operation
quartz-frontend copied to clipboard

Add auth when getting api data

Open peterdudfield opened this issue 3 years ago • 2 comments

Detailed Description

Need to add authenticathion into auth route when getting the data from api.

Context

  • Would like to add auth to the api, but this means upgrading the app so that it can still pull the data
  • this has been done here

Possible Implementation

  • You will need a client id, this will be used to go to Auth0 and get a access token. Here is some documentation on this
  • Im not sure how you pass this to the api, or how often you need to do this? This might be a bit of investigation for the issue to do
  • Optional: Could you use the token from the app google login?

Testing

set up the api with fake data

  • swicth to 'issue/2-auth0' branch on the nowcasting_api
  • run 'docker-compose up '. this takes about 20 seconds to run, as lots of fake data is added
  • change nowcasting app to look at locahost:8000, in in this line of code
  • do magic code to add authentication when getting data

peterdudfield avatar Oct 14 '22 14:10 peterdudfield

hi @peterdudfield, I'm just starting to look at this issue. For an initial client ID that I'll need to get an access token, will it be possible to start by using the client ID in my .env.local file in the nowcasting app?

rachel-labri-tipton avatar Oct 20 '22 11:10 rachel-labri-tipton

see slack, ive message you there- thanks for looking into this

peterdudfield avatar Oct 20 '22 12:10 peterdudfield