How to authenticate using the JWT auth method

Hey there,

I am trying to figure out how to use the Consul HTTP API using a JWT.
I have successfully:

  • created an auth method with the type “JWT”
  • created a binding between a (previously created) role and the auth method
  • tested the role using a dedicated token
  • used the CLI login command to get a token while providing a valid JWT

However, I would like to use the HTTP API directly with my JWT to authenticate and interact with Consul or get a Consul token using the HTTP API similar to the CLI login command.

Is this even possible? How am I supposed to use the JWT auth method?

Best regards
Eric

You would use the login HTTP endpoint to login with your JWT and then use the Consul ACL token that it returns to you for future API calls. When you are done there is also a corresponding logout endpoint.