dwyl / auth-mvp

:key: Prototype Authentication Service
https://auth-mvp.herokuapp.com/
4 stars 0 forks source link

Create /person/info endpoint #7

Open SimonLab opened 4 years ago

SimonLab commented 4 years ago

Now that the auth service returns a jwt on authenticate, we want to be able to fetch the information about a person based on this jwt.

SimonLab commented 4 years ago

The request on /person/info must contains the the Authorization field in the headers: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization

We can create a plug which will verify the jwt exist and is valid in the headers. This plug can then be used on the endpoints where authorisation is necessary: https://hexdocs.pm/phoenix/plug.html

SimonLab commented 4 years ago

At the moment the only information returned for a person is her email. To be able to link other data to this person from other application we need to have a unique reference to this user. We can for now use the id of the person from Postgres and we can later on find a more unique value to represent this person (cid?)