Skip to content

Commit

Permalink
update example jwt signatures with new secret
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wiesenbauer committed Aug 2, 2024
1 parent 9970305 commit 63f1bfa
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion examples/echo-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ To try this out:

* Install all dependencies with `go mod vendor`.
* Run `go run .` to start the app.
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `secret`.
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `your-256-bit-secret-is-just-enough`.
* Call `http://localhost:3000` with the JWT to get a response back.
8 changes: 4 additions & 4 deletions examples/echo-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

// Try it out with:
//
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.XFhrzWzntyINkgoRt2mb8dES84dJcuOoORdzKfwUX70
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.vGyNujM1eq72NzG-XscuEgjOAVP1WZXJUqSyuaJJd3s
//
// which is signed with 'secret' and has the data:
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
//
// {
// "iss": "go-jwt-middleware-example",
Expand All @@ -26,9 +26,9 @@ import (
//
// You can also try out the custom validation with:
//
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.Jf13PY_Oyu2x3Gx1JQ0jXRiWaCOb5T2RbKOrTPBNHJA
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.oWqSLPLRzF2upnnIUls0rE8rANy_IaC0qrV-jjOm89M
//
// which is signed with 'secret' and has the data:
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
//
// {
// "iss": "go-jwt-middleware-example",
Expand Down
2 changes: 1 addition & 1 deletion examples/echo-example/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

var (
// The signing key for the token.
signingKey = []byte("secret")
signingKey = []byte("your-256-bit-secret-is-just-enough")

// The issuer of our token.
issuer = "go-jwt-middleware-example"
Expand Down
2 changes: 1 addition & 1 deletion examples/gin-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ To try this out:

* Install all dependencies with `go mod vendor`.
* Run `go run .` to start the app.
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `secret`.
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `your-256-bit-secret-is-just-enough`.
* Call `http://localhost:3000` with the JWT to get a response back.
8 changes: 4 additions & 4 deletions examples/gin-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

// Try it out with:
//
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.XFhrzWzntyINkgoRt2mb8dES84dJcuOoORdzKfwUX70
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.efMBnTwQly3QNK8RxZeI8nscQVKMEtVqZUXC9MA6JsQ
//
// which is signed with 'secret' and has the data:
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
//
// {
// "iss": "go-jwt-middleware-example",
Expand All @@ -26,9 +26,9 @@ import (
//
// You can also try out the custom validation with:
//
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.Jf13PY_Oyu2x3Gx1JQ0jXRiWaCOb5T2RbKOrTPBNHJA
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.oWqSLPLRzF2upnnIUls0rE8rANy_IaC0qrV-jjOm89M
//
// which is signed with 'secret' and has the data:
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
//
// {
// "iss": "go-jwt-middleware-example",
Expand Down
2 changes: 1 addition & 1 deletion examples/gin-example/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

var (
// The signing key for the token.
signingKey = []byte("secret")
signingKey = []byte("your-256-bit-secret-is-just-enough")

// The issuer of our token.
issuer = "go-jwt-middleware-example"
Expand Down
2 changes: 1 addition & 1 deletion examples/http-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ To try this out:

* Install all dependencies with `go mod vendor`.
* Run `go run main.go` to start the app.
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `secret`.
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `your-256-bit-secret-is-just-enough`.
* Call `http://localhost:3000` with the JWT to get a response back.
11 changes: 5 additions & 6 deletions examples/http-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import (

"github.com/auth0/go-jwt-middleware/v2"
"github.com/auth0/go-jwt-middleware/v2/validator"
jwtmiddleware "github.com/auth0/go-jwt-middleware/v2"
)

var (
signingKey = []byte("secret")
signingKey = []byte("your-256-bit-secret-is-just-enough")
issuer = "go-jwt-middleware-example"
audience = []string{"audience-example"}
)
Expand Down Expand Up @@ -94,9 +93,9 @@ func main() {

// Try it out with:
//
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.XFhrzWzntyINkgoRt2mb8dES84dJcuOoORdzKfwUX70
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.efMBnTwQly3QNK8RxZeI8nscQVKMEtVqZUXC9MA6JsQ
//
// which is signed with 'secret' and has the data:
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
// {
// "iss": "go-jwt-middleware-example",
// "aud": "audience-example",
Expand All @@ -108,9 +107,9 @@ func main() {
//
// You can also try out the custom validation with:
//
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.Jf13PY_Oyu2x3Gx1JQ0jXRiWaCOb5T2RbKOrTPBNHJA
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.oWqSLPLRzF2upnnIUls0rE8rANy_IaC0qrV-jjOm89M
//
// which is signed with 'secret' and has the data:
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
// {
// "iss": "go-jwt-middleware-example",
// "aud": "audience-example",
Expand Down
2 changes: 1 addition & 1 deletion examples/iris-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ To try this out:

* Install all dependencies with `go mod vendor`.
* Run `go run .` to start the app.
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `secret`.
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `your-256-bit-secret-is-just-enough`.
* Call `http://localhost:3000` with the JWT to get a response back.
8 changes: 4 additions & 4 deletions examples/iris-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (

// Try it out with:
//
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.XFhrzWzntyINkgoRt2mb8dES84dJcuOoORdzKfwUX70
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.efMBnTwQly3QNK8RxZeI8nscQVKMEtVqZUXC9MA6JsQ
//
// which is signed with 'secret' and has the data:
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
//
// {
// "iss": "go-jwt-middleware-example",
Expand All @@ -25,9 +25,9 @@ import (
//
// You can also try out the custom validation with:
//
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.Jf13PY_Oyu2x3Gx1JQ0jXRiWaCOb5T2RbKOrTPBNHJA
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.oWqSLPLRzF2upnnIUls0rE8rANy_IaC0qrV-jjOm89M
//
// which is signed with 'secret' and has the data:
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
//
// {
// "iss": "go-jwt-middleware-example",
Expand Down
2 changes: 1 addition & 1 deletion examples/iris-example/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

var (
// The signing key for the token.
signingKey = []byte("secret")
signingKey = []byte("your-256-bit-secret-is-just-enough")

// The issuer of our token.
issuer = "go-jwt-middleware-example"
Expand Down

0 comments on commit 63f1bfa

Please sign in to comment.