Since my upgrade, things looks ok but somehow I do not get any bearerToken back
Was working minutes ago on 5.12 and I haven’t changed a single line of code since the upgrade.
Any idea what could’ve changed?
I am using an LiteDb UserAuth repo and a custom UserSession.
Here is my AuthFeature PlugIn config.
Plugins.Add(new AuthFeature(() => new PEUserSession(), new IAuthProvider[]
{
new CredentialsAuthProvider(AppSettings),
new ApiKeyAuthProvider(AppSettings),
new JwtAuthProvider()
{
HashAlgorithm = "RS256", PrivateKeyXml = Encryption.GetPrivateKey(),
RequireSecureConnection = config.RequireSecureConnection,
UseTokenCookie = true,
CreatePayloadFilter = (payload, session) =>
{
var customSession = (PEUserSession)session;
payload["domain"] = customSession.Domain;
payload["soaUsername"] = customSession.SOAUsername;
payload["ppaUsername"] = customSession.PPAUsername;
payload["ppaUserId"] = customSession.PPAUserId.ToString();
payload["ttl"] = customSession.TTL.ToString();
payload["idleTimeOut"] = customSession.IdleTimeOut.ToString();
},
PopulateSessionFilter = ((session, payload, req) =>
{
var customUserSession = session as PEUserSession;
if (customUserSession!=null)
{
customUserSession.Domain = payload["domain"];
customUserSession.SOAUsername = payload["soaUsername"];
customUserSession.PPAUsername = payload["ppaUsername"];
if (int.TryParse(payload["ppaUserId"], out var userId))
customUserSession.PPAUserId = userId;
if (int.TryParse(payload["ttl"], out var ttl))
customUserSession.TTL = ttl;
if (int.TryParse(payload["idleTimeOut"], out var idleTimeOut))
customUserSession.IdleTimeOut = idleTimeOut;
}
})
},
new ADAuthProvider (this)
{
},
new LdapAuthProvider(container.Resolve<IPPAUoW>(),container.Resolve<ISOAUoW>(), config),
})
{ HtmlRedirect = null, IncludeRegistrationService = true });
[DataContract]
public class PEUserSession: AuthUserSession
{
[DataMember]
public string Domain { get; set; }
[DataMember]
public string SOAUsername { get; set; }
[DataMember]
public string PPAUsername { get; set; }
[DataMember]
public int PPAUserId { get; set; }
[DataMember]
public int TTL { get; set; }
[DataMember]
public int IdleTimeOut { get; set; }
}