Skip to content

Commit 6ec2b74

Browse files
author
Michael Wiesenbauer
committed
update example jwt signatures with new secret
1 parent 9372d2a commit 6ec2b74

File tree

11 files changed

+24
-25
lines changed

11 files changed

+24
-25
lines changed

examples/echo-example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ To try this out:
88

99
* Install all dependencies with `go mod vendor`.
1010
* Run `go run .` to start the app.
11-
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `secret`.
11+
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `your-256-bit-secret-is-just-enough`.
1212
* Call `http://localhost:3000` with the JWT to get a response back.

examples/echo-example/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111

1212
// Try it out with:
1313
//
14-
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.XFhrzWzntyINkgoRt2mb8dES84dJcuOoORdzKfwUX70
14+
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.vGyNujM1eq72NzG-XscuEgjOAVP1WZXJUqSyuaJJd3s
1515
//
16-
// which is signed with 'secret' and has the data:
16+
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
1717
//
1818
// {
1919
// "iss": "go-jwt-middleware-example",
@@ -26,9 +26,9 @@ import (
2626
//
2727
// You can also try out the custom validation with:
2828
//
29-
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.Jf13PY_Oyu2x3Gx1JQ0jXRiWaCOb5T2RbKOrTPBNHJA
29+
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.oWqSLPLRzF2upnnIUls0rE8rANy_IaC0qrV-jjOm89M
3030
//
31-
// which is signed with 'secret' and has the data:
31+
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
3232
//
3333
// {
3434
// "iss": "go-jwt-middleware-example",

examples/echo-example/middleware.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

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

1818
// The issuer of our token.
1919
issuer = "go-jwt-middleware-example"

examples/gin-example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ To try this out:
88

99
* Install all dependencies with `go mod vendor`.
1010
* Run `go run .` to start the app.
11-
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `secret`.
11+
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `your-256-bit-secret-is-just-enough`.
1212
* Call `http://localhost:3000` with the JWT to get a response back.

examples/gin-example/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111

1212
// Try it out with:
1313
//
14-
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.XFhrzWzntyINkgoRt2mb8dES84dJcuOoORdzKfwUX70
14+
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.efMBnTwQly3QNK8RxZeI8nscQVKMEtVqZUXC9MA6JsQ
1515
//
16-
// which is signed with 'secret' and has the data:
16+
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
1717
//
1818
// {
1919
// "iss": "go-jwt-middleware-example",
@@ -26,9 +26,9 @@ import (
2626
//
2727
// You can also try out the custom validation with:
2828
//
29-
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.Jf13PY_Oyu2x3Gx1JQ0jXRiWaCOb5T2RbKOrTPBNHJA
29+
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.oWqSLPLRzF2upnnIUls0rE8rANy_IaC0qrV-jjOm89M
3030
//
31-
// which is signed with 'secret' and has the data:
31+
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
3232
//
3333
// {
3434
// "iss": "go-jwt-middleware-example",

examples/gin-example/middleware.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

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

1818
// The issuer of our token.
1919
issuer = "go-jwt-middleware-example"

examples/http-example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ To try this out:
88

99
* Install all dependencies with `go mod vendor`.
1010
* Run `go run main.go` to start the app.
11-
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `secret`.
11+
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `your-256-bit-secret-is-just-enough`.
1212
* Call `http://localhost:3000` with the JWT to get a response back.

examples/http-example/main.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ import (
1010

1111
"github.com/auth0/go-jwt-middleware/v2"
1212
"github.com/auth0/go-jwt-middleware/v2/validator"
13-
jwtmiddleware "github.com/auth0/go-jwt-middleware/v2"
1413
)
1514

1615
var (
17-
signingKey = []byte("secret")
16+
signingKey = []byte("your-256-bit-secret-is-just-enough")
1817
issuer = "go-jwt-middleware-example"
1918
audience = []string{"audience-example"}
2019
)
@@ -94,9 +93,9 @@ func main() {
9493

9594
// Try it out with:
9695
//
97-
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.XFhrzWzntyINkgoRt2mb8dES84dJcuOoORdzKfwUX70
96+
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.efMBnTwQly3QNK8RxZeI8nscQVKMEtVqZUXC9MA6JsQ
9897
//
99-
// which is signed with 'secret' and has the data:
98+
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
10099
// {
101100
// "iss": "go-jwt-middleware-example",
102101
// "aud": "audience-example",
@@ -108,9 +107,9 @@ func main() {
108107
//
109108
// You can also try out the custom validation with:
110109
//
111-
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.Jf13PY_Oyu2x3Gx1JQ0jXRiWaCOb5T2RbKOrTPBNHJA
110+
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.oWqSLPLRzF2upnnIUls0rE8rANy_IaC0qrV-jjOm89M
112111
//
113-
// which is signed with 'secret' and has the data:
112+
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
114113
// {
115114
// "iss": "go-jwt-middleware-example",
116115
// "aud": "audience-example",

examples/iris-example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ To try this out:
88

99
* Install all dependencies with `go mod vendor`.
1010
* Run `go run .` to start the app.
11-
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `secret`.
11+
* Use [jwt.io](https://jwt.io/) to generate a JWT signed with the HS256 algorithm and `your-256-bit-secret-is-just-enough`.
1212
* Call `http://localhost:3000` with the JWT to get a response back.

examples/iris-example/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010

1111
// Try it out with:
1212
//
13-
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.XFhrzWzntyINkgoRt2mb8dES84dJcuOoORdzKfwUX70
13+
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.efMBnTwQly3QNK8RxZeI8nscQVKMEtVqZUXC9MA6JsQ
1414
//
15-
// which is signed with 'secret' and has the data:
15+
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
1616
//
1717
// {
1818
// "iss": "go-jwt-middleware-example",
@@ -25,9 +25,9 @@ import (
2525
//
2626
// You can also try out the custom validation with:
2727
//
28-
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.Jf13PY_Oyu2x3Gx1JQ0jXRiWaCOb5T2RbKOrTPBNHJA
28+
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyIsInNob3VsZFJlamVjdCI6dHJ1ZX0.oWqSLPLRzF2upnnIUls0rE8rANy_IaC0qrV-jjOm89M
2929
//
30-
// which is signed with 'secret' and has the data:
30+
// which is signed with 'your-256-bit-secret-is-just-enough' and has the data:
3131
//
3232
// {
3333
// "iss": "go-jwt-middleware-example",

examples/iris-example/middleware.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

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

1818
// The issuer of our token.
1919
issuer = "go-jwt-middleware-example"

0 commit comments

Comments
 (0)