# OIDC token\_type issue, Token type must be Bearer

**URL:** <https://discuss.elastic.co/t/oidc-token-type-issue-token-type-must-be-bearer/288655>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [November 8, 2021, 3:57pm UTC](https://discuss.elastic.co/t/oidc-token-type-issue-token-type-must-be-bearer/288655 "2021-11-08T15:57:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ibrooes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ibrooes/32/96716_2.png) [@ibrooes](https://discuss.elastic.co/u/ibrooes)\
**Post date:** [November 8, 2021, 3:57pm UTC](https://discuss.elastic.co/t/oidc-token-type-issue-token-type-must-be-bearer/288655/1 "2021-11-08T15:57:00Z")

</div>

Hi, I am trying to setup OIDC Authentication. Open ID Connect Provider I am using sends id\_token, access token, etc. All tokens are JWT. The issue I am facing is token\_type field sent from Open ID Connect provider. The value of the field is 'jwt'. It seems that this caues issues with the authentication process since in logs on my deployment I get the following error:

Authentication to realm oidc1 failed - Failed to authenticate user with OpenID Connect (Caused by ElasticsearchSecurityException[Failed to exchange code for Id Token using the Token Endpoint. Unable to parse Token Response]; nested: ParseException[Token type must be Bearer]😉

Is there a way to configure my realm so that it accepts different values for token\_type? Thanks

---

<div class="post-metadata">

**Author:** ![ibrooes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ibrooes/32/96716_2.png) [@ibrooes](https://discuss.elastic.co/u/ibrooes)\
**Post date:** [November 9, 2021, 9:22am UTC](https://discuss.elastic.co/t/oidc-token-type-issue-token-type-must-be-bearer/288655/2 "2021-11-09T09:22:35Z")

</div>

@Yang_Wang is it possible to adjust tcp\_retries2 in Elastic on Azure managed service?

---

<div class="post-metadata">

**Author:** ![Yang\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yang_wang/32/48857_2.png) [@Yang\_Wang](https://discuss.elastic.co/u/Yang_Wang)\
**Post date:** [November 9, 2021, 10:31pm UTC](https://discuss.elastic.co/t/oidc-token-type-issue-token-type-must-be-bearer/288655/3 "2021-11-09T22:31:34Z")

</div>

> [@ibrooes](#):
>
> is it possible to adjust tcp\_retries2 in Elastic on Azure managed service?

Are you on [Elastic Cloud](https://www.elastic.co/cloud/?ultron=B-Stack-Trials-APJ-ANZ-Exact&gambit=Cloud-Core&blade=adwords-s&hulk=paid&Device=c&thor=elastic%20cloud&gclid=CjwKCAiA1aiMBhAUEiwACw25Mej-hwUj4jd-qQhufjxCaIFl3I_yFuWkD6E8wG8SpSSKECKwgCtTVBoCBGIQAvD_BwE)? If that's the case, you should raise a support ticket for the issue which is better for collecting all necessary information and working out a solution.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 7, 2021, 10:32pm UTC](https://discuss.elastic.co/t/oidc-token-type-issue-token-type-must-be-bearer/288655/4 "2021-12-07T22:32:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
