Skip to content

Microservice pattern: Access token #2689

Open

Description

@iluwatar

Description:
The Access Token design pattern is crucial for managing secure communication between microservices. This pattern involves the use of tokens, typically JWT (JSON Web Tokens), to verify the identity and permissions of a user or service making a request to another service. Implementing this pattern enhances security, scalability, and maintainability of microservices by decoupling authentication logic from individual services.

Main Elements:

  1. Token Issuance: A trusted authority (Authorization Server) issues tokens after authenticating a user or service.
  2. Token Validation: Microservices validate the tokens to ensure the request is authenticated and authorized.
  3. Token Scope and Permissions: Tokens carry claims about the user's identity and permissions, defining what resources and operations the user is allowed to access.
  4. Token Expiry and Refresh: Tokens have a limited lifespan, and mechanisms must be in place to refresh tokens when they expire.
  5. Security Measures: Implementing security measures to protect tokens in transit and at rest, including the use of HTTPS and secure storage.

References:

Acceptance Criteria:

  1. Implement a token issuance mechanism using a trusted Authorization Server.
  2. Ensure microservices can validate the tokens received in incoming requests.
  3. Define token scopes and permissions to control access to different resources and operations.
  4. Implement token expiry and refresh mechanisms to manage token lifecycle.
  5. Ensure all communication involving tokens is secure, using HTTPS and appropriate storage solutions for tokens.

Please ensure adherence to the project contribution guidelines while working on this issue.

Activity

  1. converted this from a draft issue on Oct 15, 2023
  2. surjendu104 commented on Oct 19, 2023

    @surjendu104
    Contributor

    I'm interested in this issue.
    would I have to demonstrate how we can perform authentication by Access tokens (JWT) with the help of controller and service and other layers?

  3. moved this from Todo to In Progress in Java Design Patterns projecton Oct 22, 2023
  4. iluwatar commented on Oct 22, 2023

    @iluwatar
    OwnerAuthor

    That plan sounds right to me @surjendu104

  5. stale commented on Dec 21, 2023

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.

  6. added
    status: staleissues and pull requests that have not had recent interaction
    on Dec 21, 2023
  7. removed
    status: staleissues and pull requests that have not had recent interaction
    on Mar 24, 2024
  8. moved this from In Progress to Todo in Java Design Patterns projecton Mar 24, 2024
  9. github-actions commented on Jan 6, 2025

    @github-actions

    This issue is stale because it has been open 60 days with no activity.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions