package
2.0.0-20220530142741-3dee01339869
Repository: https://github.com/authok/go-jwt-middleware.git
Documentation: pkg.go.dev
# README
HTTP JWKS example
This is an example of how to use the http middleware with JWKS.
Using it
To try this out:
- Install all dependencies with
go mod vendor
. - Go to authok and create a new API.
- Go to the "Test" tab of the API and copy the cURL example.
- Run the cURL example in your terminal and copy the
access_token
from the response. The tool jq can be helpful for this. - In the example change
<your tenant domain>
on line 29 to the domain used in the cURL request and<your api identifier>
on line 42 to your API identifier found inside your authok dashboard. - Run the example with
go run main.go
. - In a new terminal use cURL to talk to the API:
curl -v --request GET --url http://localhost:3000
. - Now try it again with the
access_token
you copied earlier and runcurl -v --request GET --url http://localhost:3000 --header "authorization: Bearer $TOKEN"
to see a successful request.