Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create /person/info endpoint #7

Open
1 task done
SimonLab opened this issue Feb 18, 2020 · 2 comments
Open
1 task done

Create /person/info endpoint #7

SimonLab opened this issue Feb 18, 2020 · 2 comments
Assignees
Labels

Comments

@SimonLab
Copy link
Member

SimonLab commented Feb 18, 2020

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.

  • Create the /person/info endpoint where the header of the request will contain the jwt.
@SimonLab SimonLab added the T2h label Feb 18, 2020
@SimonLab SimonLab self-assigned this Feb 18, 2020
@SimonLab
Copy link
Member Author

SimonLab commented Feb 18, 2020

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
Copy link
Member Author

SimonLab commented Mar 6, 2020

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?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant