# Creating Users and Authenticating using JWT Tokens

**URL:** <https://forum.opensearch.org/t/creating-users-and-authenticating-using-jwt-tokens/2507>\
**Category:** Security\
**Created:** [April 1, 2020, 11:25am UTC](https://forum.opensearch.org/t/creating-users-and-authenticating-using-jwt-tokens/2507 "2020-04-01T11:25:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smanjunath](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@smanjunath](https://forum.opensearch.org/u/smanjunath)\
**Post date:** [April 1, 2020, 11:25am UTC](https://forum.opensearch.org/t/creating-users-and-authenticating-using-jwt-tokens/2507/1 "2020-04-01T11:25:27Z")

</div>

I am new to opendistro.

I am trying to set up the Elastic Search and Kibana using OpenDistro. Main objective is to create authorization tokens for the users. Using these tokens,will be tracking the sessions

Added the following in config.yml

```
jwt_auth_domain:
    description: "Authenticate via Json Web Token"
    http_enabled: true #updated this to true
    transport_enabled: false
    order: 0
    http_authenticator:
      type: jwt
      challenge: true #Updated this to true
      config:
        signing_key: "base64 encoded HMAC key or public RSA/ECDSA pem key"
        jwt_header: "Authorization"
        jwt_url_parameter: null
        roles_key: null
        subject_key: null

```

Then added internal\_users.yml

```
username:
  hash: "[HASH_KEY_HERE]"
  reserved: false
  hidden: false
  backend_roles:
    - "admin"
  attributes:
  attribute1: "value1"
  static: false

```

After, this I am not able to login to kibana using user [username]. It says invalid username or pwd

But, I am able to login using kibanaserver which is the default user pwd.

However,This does not enable to add the roles and users. Screen shot below.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/1X/8e8f9dec71636351a377c256bdd3984b23c58d38.png)

Basically, I want to enable Basic Auth and JWT tokens. So that i get bearer token using the basic auth on Kibana

what is it that I am missing?

---

<div class="post-metadata">

**Author:** ![Anthony](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/anthony/32/9939_2.png) [@Anthony](https://forum.opensearch.org/u/Anthony)\
**Post date:** [May 10, 2021, 8:38am UTC](https://forum.opensearch.org/t/creating-users-and-authenticating-using-jwt-tokens/2507/2 "2021-05-10T08:38:52Z")

</div>

@smanjunath Did you get this resolved?  
If not, can you share your config.yml (redact any sensitive information).

Also after creating the new user via internal\_users.yml, did you upload the new configuration to security index via securityadmin.sh script?
