Skip to main content
Answer

API request works for basic auth but not for Oauth 2.0

  • June 11, 2025
  • 2 replies
  • 42 views

Mark Leunissen
Hero
Forum|alt.badge.img+4

Hi,

 

I am running into a weird issue with an API request. Firstly, I’ve made a client application on my test environment (which is hosted on Azure). Sending both post and get requests work perfectly with the client credentials.

After testing on the test environment, I moved on to testing on the acc environment. I have created the client application in the same way as on the test environment. However, the acc environment is hosted on premise. 

When trying the same api request for the acc environment, I get the following error:

Specifically: Bearer error="invalid_token", error_description="The issuer 'https://p2p-acc.tkb.nl/indicium' is invalid". I am trying to figure out how to fix this error, however there is a third party the is in charge of the on premise environment which also cant seem to figure out how this error is solved. 

Has anyone else ran into this issue? And how did you solve this error?

The request does work for a basic auth request, even with the exact same rights as the client application has.

Kind regards,

Mark

Best answer by Dani

Hey ​@Mark Leunissen ,

Could you please check if the appsettings " BearerTokenAuthority ” has been setup correctly?

For more information please check our documentation about OAuth bearer token (nr. 8)
https://docs.thinkwisesoftware.com/docs/iam/client_apps_certificates#oauth-bearer-token-example

 

Hope it helps.

Kind regards, 

Dani

This topic has been closed for replies.

2 replies

Dani
Moderator
Forum|alt.badge.img+2
  • Moderator
  • Answer
  • June 12, 2025

Hey ​@Mark Leunissen ,

Could you please check if the appsettings " BearerTokenAuthority ” has been setup correctly?

For more information please check our documentation about OAuth bearer token (nr. 8)
https://docs.thinkwisesoftware.com/docs/iam/client_apps_certificates#oauth-bearer-token-example

 

Hope it helps.

Kind regards, 

Dani


Mark Leunissen
Hero
Forum|alt.badge.img+4

Hi ​@Dani 

 

The " BearerTokenAuthority ” was indeed not set up correctly. Works like a charm now!

Thanks.

 

Kind regards,

Mark