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

Accept ready-made JWTs in API #2483

Closed
Tracked by #2481
lunkwill42 opened this issue Oct 26, 2022 · 0 comments · Fixed by #2511
Closed
Tracked by #2481

Accept ready-made JWTs in API #2483

lunkwill42 opened this issue Oct 26, 2022 · 0 comments · Fixed by #2511
Assignees

Comments

@lunkwill42
Copy link
Member

lunkwill42 commented Oct 26, 2022

A sort of MVP for JWT tokens in NAV would be to have the API simply accept valid JWT tokens as authorization:

  • The API must require JWTs to be cryptographically signed by a trusted key (RS256).
  • The API must require JWTs to have an expiry date claim.
  • The API must require JWTs to have a not-before date claim.

SimpleJWT is a potential candidate for library to use here - BUT, SimpleJWT seems to have a dependency on the Django user model that NAV does not support. API endpoints in NAV do not perform operations on behalf of specific users, so the user model is irrelevant for NAV API atm. We might want to fork some of SimpleJWT's code to complete this MVP.

This functionality can be tested by manually constructing and signing a JWT token, submitting this to any API endpoint in NAV for authorization.

This MVP does not need to consider access claims at all. These can be defined later.

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

Successfully merging a pull request may close this issue.

2 participants