Does anyone have experience connecting to Identity Server in 9.1 to get an authentication token / cookie of sorts?

I'm trying to do this in PowerShell.

In Commerce 9.x, you could connect directly to IdentityServer's /connect/token endpoint to obtain a token that you could then use to send requests to the engine.

In XP 9.1, I'm trying to make calls to various /sitecore pages using PowerShell to help "warm-up" the instance. In the past I was shown how to access /sitecore/login in order to populate a $session object. What does that look like now with IdentityServer?

2 Answers 2


With some serious Googling, and with the help of the Community and this gist I was able to successfully get a token from Sitecore 9.1's Identity Server.

First, you need to add a new Client to the Sitecore.IdentityServer.Host.xml file (\Config\production\Sitecore.IdentityServer.Host.xml).

I dug up more details on the PasswordClient and created my own version by copying PasswordClient as a template and called it PostmanClient giving it a client id of "postman-api".


Once that was done (and I restarted identity server) I was able to use the gist sample and provide values relevant to my newly added client:

$identityserverUrl = "https://<url-to-your-identityserver>"
$tokenendpointurl = $identityserverUrl + "/connect/token"
$granttype = "password" # client_credentials / password 
$client_id = "postman-api"
$client_secret = "ClientSecret"
$username = "sitecore\admin"
$password = "superStrongPassword"
$scope = "openid"

We are then left with an access_token which can be used to connect to Sitecore.


But what i have trying since 10 days is to have the client_credentials based configuration set up, It says invalid client id, Is it only here we have to configure or i am missing some thing. \Config\production\Sitecore.IdentityServer.Host.xml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.