Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/curityio/go-api-jwt-validation
An example OAuth protected RESTful API implemented in Go
https://github.com/curityio/go-api-jwt-validation
api claims code-example golang jwt-validation oauth2 scopes zero-trust
Last synced: 15 days ago
JSON representation
An example OAuth protected RESTful API implemented in Go
- Host: GitHub
- URL: https://github.com/curityio/go-api-jwt-validation
- Owner: curityio
- License: apache-2.0
- Created: 2021-08-13T22:55:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-14T18:35:34.000Z (over 2 years ago)
- Last Synced: 2024-12-03T11:11:56.687Z (2 months ago)
- Topics: api, claims, code-example, golang, jwt-validation, oauth2, scopes, zero-trust
- Language: Go
- Homepage: https://curity.io/resources/learn/go-api/
- Size: 23.4 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Validate JWTs in Go
=============================================[![Quality](https://img.shields.io/badge/quality-experiment-red)](https://curity.io/resources/code-examples/status/)
[![Availability](https://img.shields.io/badge/availability-source-blue)](https://curity.io/resources/code-examples/status/)An example API in Go integrated with [JSON Web Token for Go](https://github.com/gbrlsnchs/jwt) to perform JWT verification and validation for API Authorization.
## Run the example
Set appropriate config in `api/.env`
Build and run the Docker image.
```shell
docker build -t go-api .
docker run --name go-api -p 8080:8080 go-api
```NOTE: The example uses the `RS256` algorithm by default. The code can be modified to support others and there's a method that implements the EdDSA algorithm that can be invoked.
## Documentation
This repository is documented and described in the [Securing a Go API with JWTs](https://curity.io/resources/learn/go-api/) article.## Contributing
Pull requests are welcome. To do so, just fork this repo, and submit a pull request.
## License
The files and resources maintained in this repository are licensed under the Apache 2 license.
## More Information
Please visit curity.io for more information about the Curity Identity Server.
Copyright (C) 2021 Curity AB.