Hi,
i have enabled to auth using NetCoreIdentityAuthProvider as follows
private IPlugin CreateAuthFeature() =>
new AuthFeature(SessionFactory,
new IAuthProvider[] {CreateNetCoreIdentityAuthProvider()});
private IAuthSession SessionFactory() => new MyIdentityServerSession();
/// <summary>
/// Adapter to enable ASP.NET Core Identity Auth in ServiceStack
/// </summary>
private NetCoreIdentityAuthProvider CreateNetCoreIdentityAuthProvider() =>
new NetCoreIdentityAuthProvider(AppSettings) {PopulateSessionFilter = PopulateSessionFilter};
But when i add the [Authorize] attribute to a service i get the hasSession to be null in the ServiceStack.Auth.AuthProviderExtensions
internal static bool PopulateFromRequestIfHasSessionId(this IRequest req, object requestDto)
{
var hasSession = requestDto as IHasSessionId;
if (hasSession?.SessionId != null)
{
req.SetSessionId(hasSession.SessionId);
return true;
}
return false;
}
For information i’m authenticated and have a correct JWT token sent in the header.
What am I missing?