Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Releases: leveled-cv/token-authentication-library

Token Authentication Library 0.1.0

Choose a tag to compare

@github-actions github-actions released this 20 Sep 18:41

Token Authentication Library v0.1.0

📦 Maven Dependency

GitHub Packages:

<dependency>
    <groupId>com.leveledcv</groupId>
    <artifactId>token-authentication-lib</artifactId>
    <version>0.1.0</version>
</dependency>

Add this repository to your pom.xml:

<repositories>
    <repository>
        <id>github</id>
        <url>https://maven.pkg.github.com/leveledcv/token-authentication-library</url>
    </repository>
</repositories>

Features

  • ✅ @RequireAuth annotation for method and class-level authentication
  • ✅ Configurable token verification service URL
  • ✅ Automatic token extraction from HTTP headers
  • ✅ User context available in controllers (username, email, status)
  • ✅ Thread-safe authentication context
  • ✅ Automatic 403 response for invalid tokens
  • ✅ Convenient User user = AuthUtil.getUser() access pattern

Configuration

# application.yml
auth:
  token-verify-url: http://localhost:8081/token/verify
  token-header: Authorization
  token-prefix: "Bearer "

Example Usage

@RequireAuth
@GetMapping("/protected")
public ResponseEntity<String> protectedEndpoint() {
    User user = AuthUtil.getUser();
    return ResponseEntity.ok("Hello " + user.username);
}

Full Changelog: ...v0.1.0

Token Authentication Library 0.0.1

Choose a tag to compare

@github-actions github-actions released this 20 Sep 18:07

Token Authentication Library v0.0.1

Features

  • ✅ @RequireAuth annotation for method and class-level authentication
  • ✅ Configurable token verification service URL
  • ✅ Automatic token extraction from HTTP headers
  • ✅ User context available in controllers (username, email, status)
  • ✅ Thread-safe authentication context
  • ✅ Automatic 403 response for invalid tokens
  • ✅ Convenient User user = AuthUtil.getUser() access pattern

Usage

Add this dependency to your microservice's pom.xml:

<dependency>
    <groupId>com.leveledcv</groupId>
    <artifactId>token-authentication-lib</artifactId>
    <version>0.0.1</version>
</dependency>

Configuration

# application.yml
auth:
  token-verify-url: http://localhost:8081/token/verify
  token-header: Authorization
  token-prefix: "Bearer "

Example Usage

@RequireAuth
@GetMapping("/protected")
public ResponseEntity<String> protectedEndpoint() {
    User user = AuthUtil.getUser();
    return ResponseEntity.ok("Hello " + user.username);
}

Full Changelog: ...v0.0.1