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 bearer token-based authentication #223

Open
Kaliumhexacyanoferrat opened this issue Jul 12, 2021 · 0 comments
Open

Add bearer token-based authentication #223

Kaliumhexacyanoferrat opened this issue Jul 12, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Kaliumhexacyanoferrat
Copy link
Owner

Kaliumhexacyanoferrat commented Jul 12, 2021

As the developer of a web service, I would like to secure my service by accepting and validating bearer tokens, so that I can integrate my service with the SSO system.

Example

var auth = BearerTokenAuthentication.Create()
                               .Endpoint("https://myserver/auth")
                               .ClientID(...)
                               // ...
                               .Authorization((token) => {
   // check permissions/roles here
   return new BearerTokenUser(token);
});

var securedContent = Layout.Create()
                           .Authentication(auth);

Acceptance criteria

  • The functionality is provided by the Authentication module
  • The functionality re-uses an existing library for parsing and validating a token
  • Validation against a remote server is optional
  • If the token is missing from the request, a 401 is returned
  • If the token is invalid or the user lacks permission, a 403 is returned
  • If no authorization logic is passed, the user is always considered authorized
  • The secured content can access the token if needed
  • The functionality is secured with acceptance tests
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat added the enhancement New feature or request label Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant