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

Add endpoint for validating bearer token #541

Open
eduardoboucas opened this issue Mar 28, 2019 · 0 comments
Open

Add endpoint for validating bearer token #541

eduardoboucas opened this issue Mar 28, 2019 · 0 comments

Comments

@eduardoboucas
Copy link
Contributor

In a scenario where a consumer application is using API to manage user authentication (like Publish), it's likely that bearer tokens will be stored somewhere on a client to act as session tokens. When this happens, it's important to verify with API that the token stored is still valid, allowing the application to redirect users to a sign in form if not.

Currently, Publish is hitting the /api/client endpoint in order to validate a token, obtaining useful information about the user in the process (killing two birds with one stone kind of thing). However, I wonder if it would be useful to create an endpoint that does nothing but validate an existing token, with the benefit of not having to hit the database at all. This endpoint would simply be validating the JWT and returning an empty response with an appropriate status code.

Useful? Micro-optimisation? 🤷‍♂️

cc @jimlambie

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

No branches or pull requests

1 participant