# Spring boot JWE not configured

**URL:** <https://community.auth0.com/t/spring-boot-jwe-not-configured/80106>\
**Category:** Get Help\
**Tags:** java\
**Created:** [March 18, 2022, 2:09am UTC](https://community.auth0.com/t/spring-boot-jwe-not-configured/80106 "2022-03-18T02:09:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![robert8](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robert8/32/12835_2.png) [@robert8](https://community.auth0.com/u/robert8)\
**Post date:** [March 18, 2022, 2:09am UTC](https://community.auth0.com/t/spring-boot-jwe-not-configured/80106/1 "2022-03-18T02:09:26Z")

</div>

Please include the following information in your post:

- **Which SDK this is regarding:** e.g. Spring boot
- **SDK Version:** e.g. 2.5.5
- **Platform Version:** e.g. OpenJDK 17
- **Error Messages/:** WWW-Authenticate: Bearer error=“invalid\_token”, error\_description=“An error occurred while attempting to decode the Jwt: Encrypted JWT rejected: No JWE key selector is configured”

For some reason, when moving to OpenJDK 17 from 1.8 SpringBoot can no longer decode the JWT access token. I always get the NO JWE key selector is configured.

I applied the same spring boot config as before (the one that is working now) and even the applied the same config as provided in your DOC page here:

- [Auth0 Spring Boot API SDK Quickstarts: Authorization](https://auth0.com/docs/quickstart/backend/java-spring-security5)

Is this a configuration that I need to change in my Auth0 console page?

**Is this a feature request or bug report?** : This is a question

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 18, 2022, 10:20pm UTC](https://community.auth0.com/t/spring-boot-jwe-not-configured/80106/3 "2022-03-18T22:20:50Z")

</div>

Hi @robert8,

Welcome to the Auth0 Community!

It looks like you may be receiving an opaque token. This happens when you don’t pass an `audience` parameter with your request to authorize. Can you see if you were previously passing an audience param and haven’t been passing it in your new config?

If not, can you please post an example of the token you are seeing?

---

<div class="post-metadata">

**Author:** ![lexakimov](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lexakimov/32/33806_2.png) [@lexakimov](https://community.auth0.com/u/lexakimov)\
**Post date:** [March 24, 2022, 3:50am UTC](https://community.auth0.com/t/spring-boot-jwe-not-configured/80106/4 "2022-03-24T03:50:37Z")

</div>

Hi. I got the same issue. I followet this guide [Auth0 Spring Boot API SDK Quickstarts: Authorization](https://auth0.com/docs/quickstart/backend/java-spring-security5) and used OpenJDK8, SpringBoot 2.3.0 with Spring Security 5  
My goal is to make my rest-api service secured, all requests to service must contains Authorization header with bearer token.  
I use Postman to get token from auth0:  
 ![Shot_2022-03-24_10-40-06](https://global.discourse-cdn.com/auth0/original/3X/b/7/b7733fb19f9815691269d5791df0338630251031.png)

 ![Shot_2022-03-24_10-39-46](https://global.discourse-cdn.com/auth0/original/3X/1/d/1dd5ed1fde298c8a26404db477a54474c63abba9.png)

The token i received contains Access Token and id\_token sections:

 ![Shot_2022-03-24_10-41-36](https://global.discourse-cdn.com/auth0/original/3X/8/f/8fd15971467d6305da2daa4f31ae2740bb48706d.png)  
Access token after decoding looks like:

```auto
{
  "alg": "dir",
  "enc": "A256GCM",
  "iss": "https://dev-98njlbfr.us.auth0.com/"
}

```

id\_token contains user metadata (nikcname, email, picture, iss, sub, aud…).

When i send request with access token in Authorization Header i got 401. After debugging i noticed that the jweKeySelector is null and in produces BadJOSEException(“Encrypted JWT rejected: No JWE key selector is configured”)  
What am i doing wrong?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 24, 2022, 3:17pm UTC](https://community.auth0.com/t/spring-boot-jwe-not-configured/80106/5 "2022-03-24T15:17:44Z")

</div>

Hi @lexakimov,

That header looks like an encrypted token, and you should only get these when you aren’t passing a valid audience.

Is the `http://java-backend/` a valid API Identifier you have registered in Auth0?

---

<div class="post-metadata">

**Author:** ![robert8](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robert8/32/12835_2.png) [@robert8](https://community.auth0.com/u/robert8)\
**Post date:** [March 24, 2022, 5:15pm UTC](https://community.auth0.com/t/spring-boot-jwe-not-configured/80106/6 "2022-03-24T17:15:11Z")

</div>

Thanks Dan,

That was indeed the issue. My SPA/PWA was indeed. not configured properly to access my updated set of API.

Thx !

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 24, 2022, 5:57pm UTC](https://community.auth0.com/t/spring-boot-jwe-not-configured/80106/7 "2022-03-24T17:57:46Z")

</div>

Glad we were able to figure it out!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 21, 2022, 11:58pm UTC](https://community.auth0.com/t/spring-boot-jwe-not-configured/80106/8 "2022-04-21T23:58:01Z")

</div>


