# Error while configuring JWT Authentication

**URL:** https://forum.opensearch.org/t/error-while-configuring-jwt-authentication/14729
**Category:** Security
**Tags:** troubleshoot, configure
**Created:** [June 18, 2023, 12:23pm UTC](https://forum.opensearch.org/t/error-while-configuring-jwt-authentication/14729 "2023-06-18T12:23:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![davelago](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/davelago/32/2209_2.png) [@davelago](https://forum.opensearch.org/u/davelago)
#### Post date: [June 18, 2023, 12:23pm UTC](https://forum.opensearch.org/t/error-while-configuring-jwt-authentication/14729/1 "2023-06-18T12:23:14Z")

</div>

_Moved from GitHub issue [#2872](https://github.com/opensearch-project/security/issues/2872)_

* * *

I am trying to configure JWT Authentication for my Opensearch docker container which is on V2.7.0

**How can one reproduce the bug?**  
Steps to reproduce the behavior:

1. Config file updated as follows:

```auto
jwt_auth_domain:
  http_enabled: true
  transport_enabled: true
  order: 0
  http_authenticator:
    type: jwt
    challenge: false
    config:
      signing_key: "VGhpc0lzQVRlc3ROYXRUb0JlVXNlZEFudGh3YXJl"
      jwt_header: "Authorization"
      jwt_url_parameter: null
      subject_key: "sub"
      roles_key: "roles"
      jwt_clock_skew_tolerance_seconds: 20
  authentication_backend:
    type: noop

```

**What is the expected behavior?**

[opensearch@59901e2344d3 tools]$ ./securityadmin.sh -cd …/securityconfig/ -icl -nhnv -cacert …/…/…/config/root-ca.pem -cert …/…/…/config/kirk.pem -key …/…/…/config/kirk-key.pem

> Security Admin v7  
> Will connect to localhost:9200 … done  
> Connected as “CN=kirk,OU=client,O=client,L=test,C=de”  
> OpenSearch Version: 2.7.0  
> Contacting opensearch cluster ‘opensearch’ and wait for YELLOW clusterstate …  
> Clustername: opensearch-cluster  
> Clusterstate: YELLOW  
> Number of nodes: 1  
> Number of data nodes: 1  
> .opendistro\_security index already exists, so we do not need to create one.  
> Populate config from /usr/share/opensearch/plugins/opensearch-security/securityconfig  
> ERR: Seems …/securityconfig/config.yml is not in OpenSearch Security 7 format: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field “http\_enabled” (class org.opensearch.security.securityconf.impl.v7.ConfigV7), not marked as ignorable (one known property: “dynamic”])  
> at [Source: (String)“{”\_meta":{“type”:“config”,“config\_version”:2},“config”:{“dynamic”:{“http”:{“anonymous\_auth\_enabled”:false,“xff”:{“enabled”:false,“internalProxies”:“192.168.0.10|192.168.0.11”}},“authc”:null}},“jwt\_auth\_domain”:{“http\_enabled”:true,“transport\_enabled”:true,“order”:0,“http\_authenticator”:{“type”:“jwt”,“challenge”:false,“config”:{“signing\_key”:“VGhpc0lzQVRlc3ROYXRUb0JlVXNlZEFudGh3YXJl”,“jwt\_header”:“Authorization”,“jwt\_url\_parameter”:null,“subject\_key”:“sub”,“roles\_key”:“roles”,“jwt\_clo”[truncated 816 chars]; line: 1, column: 243] (through reference chain: org.opensearch.security.securityconf.impl.SecurityDynamicConfiguration[“jwt\_auth\_domain”]-\>org.opensearch.security.securityconf.impl.v7.ConfigV7[“http\_enabled”])  
> ERR: Seems …/securityconfig/roles.yml is not in OpenSearch Security 7 format: java.io.FileNotFoundException: …/securityconfig/roles.yml (No such file or directory)  
> ERR: Seems …/securityconfig/roles\_mapping.yml is not in OpenSearch Security 7 format: java.io.FileNotFoundException: …/securityconfig/roles\_mapping.yml (No such file or directory)  
> ERR: Seems …/securityconfig/internal\_users.yml is not in OpenSearch Security 7 format: java.io.FileNotFoundException: …/securityconfig/internal\_users.yml (No such file or directory)  
> ERR: Seems …/securityconfig/action\_groups.yml is not in OpenSearch Security 7 format: java.io.FileNotFoundException: …/securityconfig/action\_groups.yml (No such file or directory)  
> ERR: Seems …/securityconfig/tenants.yml is not in OpenSearch Security 7 format: java.io.FileNotFoundException: …/securityconfig/tenants.yml (No such file or directory)  
> ERR: Seems …/securityconfig/nodes\_dn.yml is not in OpenSearch Security 7 format: java.io.FileNotFoundException: …/securityconfig/nodes\_dn.yml (No such file or directory)  
> ERR: Seems …/securityconfig/whitelist.yml is not in OpenSearch Security 7 format: java.io.FileNotFoundException: …/securityconfig/whitelist.yml (No such file or directory)

**What is your host/environment?**

- OS: Ubuntu 20.04.5 LTS
- Version 20.04.5
- Plugins

**Do you have any screenshots?**  
If applicable, add screenshots to help explain your problem.

**Do you have any additional context?**  
Add any other context about the problem.

---

<div class="post-metadata">

### Author: ![davelago](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/davelago/32/2209_2.png) [@davelago](https://forum.opensearch.org/u/davelago)
#### Post date: [June 18, 2023, 12:25pm UTC](https://forum.opensearch.org/t/error-while-configuring-jwt-authentication/14729/2 "2023-06-18T12:25:22Z")

</div>

To the original issue’s author, [gvsrini](https://github.com/gvsrini):

Could you please attach your complete `config.yml` here (redacted for privacy if needed of course)? It seems like there might be some sort of miss in where fields are and where they are expected.

---

<div class="post-metadata">

### Author: ![Eugene7](https://avatars.discourse-cdn.com/v4/letter/e/bbce88/32.png) [@Eugene7](https://forum.opensearch.org/u/Eugene7)
#### Post date: [June 19, 2023, 10:46am UTC](https://forum.opensearch.org/t/error-while-configuring-jwt-authentication/14729/3 "2023-06-19T10:46:39Z")

</div>

At the link below, you can find an example of `config.yml` file:

> <https://github.com/opensearch-project/security/blob/main/config/config.yml>
