Hi there,
I was using SS v5.9.0 and update it to the latest version i.e. v6.0.0
After updating I updated the configuration for JWT Token with UseTokenCookie = false
With this configuration my normal default credential auth provider with customerUserSession is working well.
When I hit my APIs with API Key it is failing to authenticate the request whereas it was working with older version.
Here are my auth config.
I used async providers as well i.e CredentialsAuthProviderSync
Plugins.Add(new AuthFeature(() =>
new CustomUserSession(),
new IAuthProvider[]
{
new ApiKeyAuthProvider(AppSettings) {
AllowInHttpParams=true,
Environments=new string[]{"live","dev","test"},
SessionCacheDuration = new TimeSpan(1, 0,0),
RequireSecureConnection = false,
},
new CredentialsAuthProviderSync(AppSettings),
new JwtAuthProvider(AppSettings)
{
AuthKeyBase64 = appConfig.EnvironmentConfig.JwtConfig.JwtAuthKeyBase64,
UseTokenCookie = false,
RequireSecureConnection = false,
EncryptPayload = appConfig.EnvironmentConfig.JwtConfig.EncryptPayload,
ExpireTokensIn=new TimeSpan(1,0, 0),
ExpireRefreshTokensIn = new TimeSpan(1,0, 0),
CreatePayloadFilter = (payload,session) =>
{
payload[Keywords.Session]=session.Id;
},
PopulateSessionFilter = (session, payload, req) =>
{
((CustomUserSession) session).UserSessionId = payload[Keywords.Session];
}
}
}));
Please suggest what changes need to be done to authenticate request with API Key.