KeycloakAuth

module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2025 License: MIT

README

Keycloak Auth Library

A library for integrating with Keycloak, providing functionalities for authentication and authorization.


Features

  • Verify JWT tokens.
  • Fetch and manage JWK (JSON Web Key) sets.
  • Role-based access control.
  • Serialize and deserialize JWK sets.
  • Define and check secure endpoints.

Installation

Install the library using go get:

go get github.com/YATAHAKI/KeycloakAuth

Usage

There's also official documentation - docs

Simple config
keycloak:
  public_jwk_uri: http://localhost:8180/realms/example-client/protocol/openid-connect/certs
  client_id: example-client
  refresh_jwk_timeout: 12h # optional/default 3h
Example: gRPC Interceptor

You can use the library to integrate with gRPC by implementing an interceptor for authentication and authorization. Check out the example in the Examples directory for more details.


License

This library is licensed under the MIT License. See the LICENSE file for details.


Contributing

Contributions are welcome! Please open an issue or submit a pull request to contribute.

Directories

Path Synopsis
Package keyimpl Package auth provides authentication and authorization mechanisms for both HTTP and gRPC services.
Package keyimpl Package auth provides authentication and authorization mechanisms for both HTTP and gRPC services.
Package models contains structures and methods for working with JWT claims and their deserialization.
Package models contains structures and methods for working with JWT claims and their deserialization.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL