I have a stand-alone hosting application in which I use Facebook Oath and Redis - Facebook and redis side of things seem to work, i.e. when i visit
abc.com/auth/facebook
The user's user session is logged into the OnAuthenticated method. The Redis cache stores data correctly .. so good
Problem Im has an understanding of how to get this CustomUserSession in a subsequent request. To start the oauth redirect page, "/ About-Us" is where I want to get the session value, but always null
[DataContract] public class CustomUserSession : AuthUserSession { [DataMember] public string CustomId { get; set; } public override void OnAuthenticated(IServiceBase authService, IAuthSession session, IAuthTokens tokens, Dictionary<string, string> authInfo) {
How do I register cache and session, etc.
AppConfig = new AppConfig(appSettings); container.Register(AppConfig); container.Register<IRedisClientsManager>(c => new PooledRedisClientManager("10.1.1.10:6379")); container.Register(c => c.Resolve<IRedisClientsManager>().GetCacheClient()); ConfigureAuth(container, appSettings);
ConfigureAuth () content
var authFeature = new AuthFeature( () => new CustomUserSession(), new IAuthProvider[] { new FacebookAuthProvider(appSettings), // override of BasicAuthProvider } ) {HtmlRedirect = null, IncludeAssignRoleServices = false}; Plugins.Add(authFeature);
I feel like I'm missing something obvious here ... thanks in advance
Mikew source share