-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Groundwork: Access tokens, login & logout #1997
Comments
Is the idea here that tokens are stored in the database or to use JWTs? |
@David-Mulder , we're planning to implement a simple authentication provider that uses JWT access token under the hood. |
Extracted from the discussion notes captured in #1035 (comment): Acceptance Criteria
|
I am little bit concerned about practical aspects of this approach. My original vision was to start from outside (the example app) and drive the internal design & implementation based on what we need to provide to API consumers. I fear that in the current proposal, we will start implementation inside Personally, I would use a different plan:
Anyhow, just my two cents. |
@bajtos, couldn't the shopping-app be added to the examples and then the authentication could be developed off a feature branch? |
We are intentionally keeping the shopping example outside of our monorepo. Running tests again multiple databases is expensive, we don't want to slow down the build process for loopback-next monorepo. |
A summary of the progress in PR loopbackio/loopback4-example-shopping#26 It turns out adding a new authentication strategy in the example repository is a wise decision. In PR#26 we created the following stuff:
Discussion:
cc @strongloop/loopback-next thought? |
When write the tutorial I feel it's better to have the blog when we finish story #2311, at least people don't need to hardcode the strategy resolver to plugin their strategies. See follow-up stories:
|
Description
Step 2 from #1035 (comment).
Define a new
AccessToken
model and a relation toCustomer
(a customer has many tokens, a token belongs to a customer).Implement login and logout, expose them via REST API. Let's create a new Controller class for these endpoints!
The goal of this step is to show a reference implementation in our Shopping App and prepare ground for the actual auth-related work in the next iterations. Later, we may decide to extract AccessToken & Password models together with the relevant repositories and Controller classes into a shareable LB4 component (e.g.
@loopback/local-credentials
).Ideally, there should be a documentation and/or a blog-post and/or a reference implementation to make it easier for LB4 users to implement similar functionality in their project.
Previous step: #1996
Next step: #1998
The text was updated successfully, but these errors were encountered: