Skip to main content

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

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


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


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


Hi Dick,

 

Thanks, that would be a nice addition.

 

Kind regards,

Mark Leunissen


Reply