Skip to main content
Solved

Client application access token gets unauthorized error


Mark Leunissen
Warrior
Forum|alt.badge.img+3

Hi,

 

In my application I have created a client application with the Clien credetials type. I configured the settings as shown below: 

In Postman I entered the client credentials in a OAuth2.0 request and got the access key succesfully. However, the generated access key gets an unauthorized error.

 

The user has a role with all rights enable and has public API enabled. Additionally, I have tried adding the BearerTokenAuthority to the appsettings.json. But I am not sure if this is the right way to configure this.

 

Is this the right way to configure the BearerTokenAuthority? Or is there anything else that I am missing?

 

Kind regards,
Mark

Best answer by Dick van den Brink

Hi Mark,

 

The BearerTokenAuthority is configured wrong in the appsettings.json.

You can change it like below:

    ....
    "Database": ""
  },
  "BearerTokenAuthority": "<url>",
  "Agent":....

Or you can create the BearerTokenAuthority as an environment variable in the Azure portal as well.

Regards,

Dick van den Brink

View original
This topic has been closed for comments

Forum|alt.badge.img+3

Hi Mark,

 

The BearerTokenAuthority is configured wrong in the appsettings.json.

You can change it like below:

    ....
    "Database": ""
  },
  "BearerTokenAuthority": "<url>",
  "Agent":....

Or you can create the BearerTokenAuthority as an environment variable in the Azure portal as well.

Regards,

Dick van den Brink


Mark Leunissen
Warrior
Forum|alt.badge.img+3

Thanks Dick! That did the trick.

 

I do have an additional question about the access token. How long is the access token valid for? Is this a setting that can be adjusted?

Kind regards,

Mark Leunissen


Forum|alt.badge.img+3

Hi Mark,

An access token is valid for 60 minutes. At this time, there are no options to configure the lifetime of the token. At least, not at the time of writing.

Regards,

Dick van den Brink


Mark Leunissen
Warrior
Forum|alt.badge.img+3

Hi Dick,

 

Thanks, that would be a nice addition.

 

Kind regards,

Mark Leunissen


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings