Open SimonLab opened 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
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?)
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.
/person/info
endpoint where the header of the request will contain the jwt.