Error verifying token: oidc: malformed jwt

Facing the below error while trying to execute the following command.
export VAULT_TOKEN="$(vault write -field=token -format=json auth/jwt/login role=my-role jwt=xx.xxxxxxxxx)"
Error writing data to auth/jwt/login: Error making API request.

URL: PUT http://xxx.xxx.xxx:8200/v1/auth/jwt/login
Code: 400. Errors:

  • error verifying token: oidc: malformed jwt: square/go-jose: compact JWS format must have three parts

Just to be sure, its a valid JWT - ie, can you verify it via https://www.jsonwebtoken.io/ and it all makes sense?

1 Like