After upgrading from 4.5.6 -> 4.5.8, JWT Authentication is no longer working/returning the bearerToken in our authentication requests.
I verified by downgrading back to 4.5.6 that everything still worked without any code changes.
I’m hoping it’s just a config change that I missed in the release notes or otherwise. I do not have a stand alone project (nor do i have time at the moment to create one).
Here are the code snippets of how I have things setup.
private void ConfigureAuth(Container container)
{
IAppSettings appSettings = new AppSettings();
var auth = new AuthFeature(
() => new CustomUserSession(),
new IAuthProvider[]
{
container.Resolve<MssCredentialsAuthProvider>(),
new JwtAuthProvider(appSettings){
CreatePayloadFilter = (payload,session) =>
{
CustomUserSession customSession = session as CustomUserSession;
payload["userId"] = customSession.UserAuthId;
payload["companyId"] = customSession.Company;
payload["companyName"] = customSession.CompanyName;
payload["companyRoles"] = customSession.CompanyRoles.ToJson();
}
}
})
{
IncludeAssignRoleServices = false,
IncludeRegistrationService = false,
IncludeAuthMetadataProvider = false,
DeleteSessionCookiesOnLogout = true
};
Plugins.Add(auth);
}
My web.config has the following options defined:
<add key="jwt.RequireSecureConnection" value="false" />
<add key="jwt.AuthKeyBase64" value="hidden" />
<add key="jwt.HashAlgorithm" value="HS256" />
The MssCredentialsAuthProvider has the baseclass of CredentialsAuthProvider .