Questions tagged [jwt-go]
59 questions
0
votes
1 answer
A especific endpoint from my API dosnt give me authorization. (must be BAD DEFINITION OF REQUEST)
I have several endpoints in my APIrest and a lot of them pass through the validations of the JWT token.
When I try to update a user with my frontend app always tells me that i am not authorized.
I tried to update the user with postman and everything…

crision
- 33
- 5
0
votes
1 answer
How to get to get claims from JWT token without validation in Go
I have a JWT token with the claims below
{
"authorized": true,
"email": "sample@gmail.com",
"exp": 1589929351,
"node": "/auth/nodes0000000023",
"role": "admin"
}
The issuer of the JWT is the claims['node']. In the above claims it is the…

Victor Timofei
- 334
- 4
- 13
0
votes
1 answer
Failing to create JWT token when entering a custom email claim
I am trying to generate a JWT token using Go and I created the following function. I need to add the email address in jwt but as I do this I get an error saying key is of invalid type
func GenerateUserToken(expiryHours time.Duration, email string,…

Amanda
- 2,013
- 3
- 24
- 57
0
votes
1 answer
Key is of Invalid Type when parsing JWT Auth token in jwt-go
I am setting up security middleware in a GoLang API and seem to have everything set up correctly, but I am getting an error ‘key is of invalid type’.
I have confirmed that my Signing algorithm is RS256 and the middleware options are configured @…

beauXjames
- 8,222
- 3
- 49
- 66
0
votes
1 answer
How to override DefaultHTTPErrorHandler format message
I'm using the Echo framework.
How can I change this format response to my own format
its error from JWT Library https://github.com/dgrijalva/jwt-go
{
"message": "invalid or expired jwt"
}
i want to change something like this
{
"meta": {
…

Putra Fajar Hasanuddin
- 1,101
- 3
- 13
- 25
0
votes
1 answer
go jwt ValidationKeyGetter does not compile
I am new to go. I am trying to set up a secure webserver using go and jwt, but I cannot get this to compile:
mw := jwtmiddleware.New(jwtmiddleware.Options{
ValidationKeyGetter: func (token *jwt.Token) (interface{}, error) {
…

normcf
- 21
- 4
0
votes
1 answer
Decode JWT in golang jwt-go
What's the equivalent of this code (https://github.com/auth0/java-jwt) in golang --- jwt-go library
DecodedJWT jwt = JWT.decode(token);
in golang's jwt-go library, when I have to parse the token I need to have the verification key which is not…

Santhosh S
- 1,141
- 6
- 21
- 43
0
votes
1 answer
BOX / JWT OAuth 2.0 by golang
I want to upload image from my server without user. I made box application and setting.
I try to create JWT token and got access token. after that, I try to get file information from my Box file. but this api return 404 status.
I don't know where I…

Masahiro Yanou
- 81
- 1
- 5
0
votes
1 answer
JWT is always valid even when incorrect params passed
I'm working with the jwt-go library and I've written tests for implementing it in my application. However, no matter what token I create, it is returned as valid. I'm guessing I'm not checking for something. The documentation is out of date because…

user3162553
- 2,699
- 3
- 37
- 61
0
votes
1 answer
http.Request has undefined fields when deploying to appengine
I'm working on a web app and I depend on the following code for authentication (I'm using github.com/dgrijalva/jwt-go package):
func ValidateProtectedPage(protectedPage http.HandlerFunc) http.HandlerFunc {
return http.HandlerFunc(func(res…

Luis GG
- 81
- 1
- 8
0
votes
2 answers
go-restful + JWT authentication
I'm trying to plug JWT authentication within a very simple go service written with go-restful.
The code is very similar to:
package main
import (
"github.com/emicklei/go-restful"
"log"
"net/http"
)
type User struct {
Id, Name…

ohe
- 3,461
- 3
- 26
- 50
0
votes
1 answer
GoLang JWT with Martini throwing ?
I'm trying the JWT middleware examples to get JWT to work with Martini and it's giving me an return when it hits the authentication handler.
Here's the code, straight from the examples..
package main
import (
"encoding/json"
…

Nathan Hyland
- 842
- 2
- 13
- 28
0
votes
1 answer
Google SignIn validation error using jwt-go
I'm currently trying to integrate my app with Google SignIn. I want my Golang backend to be able to decode and validate OIDC tokens. I'm trying to use the JWT-GO library, but I'm stuck with the validation of the signature of the JWT.
I found this…

kendo5731
- 243
- 2
- 5
-1
votes
1 answer
Golang - retrieve multiple results from MySQL, then display them as JSON
Recently, I'm learning about Go (Golang). I'm trying to make a simple web service using Martini and jwt-go. I didn't find any difficulty in retrieving a single row data and put in JSON as the response. But, when dealing with multiple-rows, it's a…

asubanovsky
- 1,608
- 3
- 19
- 36