0

The default Commerce Engine implementation has a hard-coded Identity Server Api name & secret:

.AddIdentityServerAuthentication(options =>
{
    options.Authority = this.Configuration.GetSection("AppSettings:SitecoreIdentityServerUrl").Value;
    options.RequireHttpsMetadata = false;
    options.EnableCaching = false;
    options.ApiName = "EngineAPI";
    options.ApiSecret = "secret";
});

Should I change the ApiSecret to a more secure string for production usage?

3
  • will your identity server be available publicly? Aug 12, 2019 at 13:21
  • Only internally, but still, some security is required.
    – Joost
    Aug 12, 2019 at 13:33
  • you can change to something more secured but you also need to change same in identity server configuration. Aug 12, 2019 at 14:05

1 Answer 1

0

Turns out the ApiSecret is actually unused as the Commerce Engine uses JWT and not Reference tokens. See Identity Server documentation: http://docs.identityserver.io/en/latest/topics/apis.html#supporting-reference-tokens

One could change the code to:

.AddIdentityServerAuthentication(options =>
{
    options.Authority = this.Configuration.GetSection("AppSettings:SitecoreIdentityServerUrl").Value;
    options.ApiName = "EngineAPI";
});

NB. As the Identity Server by default uses RSA encryption it uses the JSON Web Keyset (available at e.g. https://identity/.well-known/openid-configuration/jwks) to verify the JWT.

Your Answer

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

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