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

auth flow, endpoint #3

Open
eduaravila opened this issue Jan 29, 2023 · 4 comments
Open

auth flow, endpoint #3

eduaravila opened this issue Jan 29, 2023 · 4 comments
Assignees
Labels
backend related to backend main / required planning planning for new feature

Comments

@eduaravila
Copy link
Owner

No description provided.

@eduaravila eduaravila self-assigned this Jan 29, 2023
@eduaravila eduaravila added the planning planning for new feature label Jan 29, 2023
@eduaravila eduaravila added backend related to backend main / required labels Jan 29, 2023
@eduaravila
Copy link
Owner Author

  • the user authenticates and authorizes with his a provider
  • the provider redirects to the auth api
  • the auth api gets the access token
  • creates / updates the user and account if necessary
  • create a jwt token / session
  • store the session on db
  • return the token to the user

should we save banned tokens on reddis???

@eduaravila
Copy link
Owner Author

eduaravila commented Jan 29, 2023

{
  "self": { "href": "https://example.io/users", "rel": ["collection"] },
  "desc": "Showing 25 of 218 users.  Use the 'next' link for the next page.",
  "offset": 0,
  "limit": 25,
  "size": 218,
  "first": { "href": "https://example.io/users", "rel": ["collection"] },
  "previous": null,
  "next": { "href": "https://example.io/users?offset=25", "rel": ["collection"] },
  "last": { "href": "https://example.io/users?offset=200", "rel": ["collection"] },
  "value": [
    {
      "self": { "href": "https://example.io/users/1" },
      "firstName": "Bob",
      "lastName": "Smith",
      "birthDate": "1977-04-18"
    },
    //... items 2-24 omitted for brevity
    {
      "self": { "href": "https://example.io/users/25" },
      "firstName": "Jane",
      "lastName": "Doe",
      "birthDate": "1980-01-23"
    }
  ]
}

@eduaravila
Copy link
Owner Author

eduaravila commented Feb 1, 2023

as a user:

  • i want to log in in to the app
  • i authorize the app to use my account

test case:

  • call the endpoint callback auth of the selected platform
  • it should create a new user
  • it should create a new account
  • it should return a new session token in a httponly cookie

@eduaravila
Copy link
Owner Author

eduaravila commented Feb 4, 2023

  • brand new user
    • create an account
    • create an user
    • return a session
  • already existing user
    • return account, return user
    • return a session
  • already existing user logs from another account (brand new user)
    • check in the accounts for the sub
    • in theres an account, theres an user
    • return all the accounts of the user
    • return a session
  • existing user authorizes another account
    • create a new account
    • link the account to the current user in the session (many [account] to one [user]) relationship

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend related to backend main / required planning planning for new feature
Projects
None yet
Development

No branches or pull requests

1 participant