-
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
Create abstraction for access token related operations in authentication module #2435
Comments
I am concerned about requiring the
I see two distinctive services in this list.
Conceptually, the first service is operating at Data/Repository level, dealing with behavior related to data. The second service is operating at Transport/Controller level, dealing with transport-specific behavior. I feel these two services are orthogonal and should be implemented independently, to make it easy to compose them in different ways. For example:
I am proposing to define two new abstractions:
|
I am not sure how much sense it makes to implement |
If the serializer is writing the token to response body, then we need a way how to describe the response schema via OpenAPI. See also #2491 (comment) |
@bajtos This was aiming to auto generate the OpenAPI schema for the endpoint that returns a user profile. See code https://github.com/strongloop/loopback4-example-shopping/blob/master/src/controllers/user.controller.ts#L85, which hardcoded the schema in the shopping example as a workaround.
Good catch! will split them into different services accordingly, like what we did for the login service, see PR #2576 |
implemented by PR #2576 . |
Description
Create abstraction for token service
generateAccessToken(user: U, options: Object): Promise<string>;
serializeAccessToken(response: Response): Promise<void>;
extractAccessToken(request: Request): Promise<string>;
verifyAccessToken(token: string): Promise<U>;
invalidateAccessToken?(token: string): Promise<boolean>;
Create unit testsCreate Markdown file for acceptance tests (includes investigation of popular token-based authentication strategies and explain how this interface works with them).The text was updated successfully, but these errors were encountered: