ServiceStack IAuthSession empty after authentication with FacebookAuthProvider -
i'm trying user data through iauthsession after doing authentication facebook, when try user request.getsession(true) returns authusersession (implements iauthsession) partial subset of data following:
i'm trying use in service method
[clientcanswaptemplates] [defaultview("dashboard")] public dashboardresponse get(facebookrequest userrequest) { var user1 = request.getsession(true); return new dashboardresponse(); }
i've added auth providers apphost follows:
plugins.add(new authfeature(() => new authusersession(), new iauthprovider[] { new facebookauthprovider(appsettings), new twitterauthprovider(appsettings), new basicauthprovider(appsettings), new googleopenidoauthprovider(appsettings), new linkedinauthprovider(appsettings), new credentialsauthprovider() }));
as far know facebookauthprovider should fill iauthsession following information:
usersession.facebookuserid = tokens.userid ?? usersession.facebookuserid; usersession.facebookusername = tokens.username ?? usersession.facebookusername; usersession.displayname = tokens.displayname ?? usersession.displayname; usersession.firstname = tokens.firstname ?? usersession.firstname; usersession.lastname = tokens.lastname ?? usersession.lastname; usersession.primaryemail = tokens.email ?? usersession.primaryemail ?? usersession.email;
what step missing?
i in similar situation issue based answer decided try out, , worked.
the difference i'm using simple injector , have consider register dependency singleton easier way me register this:
simpleinjectorcontainer.registersingle<icacheclient>(()=>new memorycacheclient());
Comments
Post a Comment