Registering and Storing External Claims in ASP.NET Identity -



Registering and Storing External Claims in ASP.NET Identity -

i'm using facebook auth , trying register user token claim can't seem work right. able working manually adding in linklogincallback method of manage controller provided default mvc template, approach seems cumbersome , incorrect, in removing , updating token.

i've read can find documentation on lacking , think have code written it's supposed never registers , stores claim in db. solution i'm working @ moment follows in startup.auth:

var fboptions = new facebookauthenticationoptions(); fboptions.scope.add("email"); fboptions.scope.add("user_photos"); fboptions.appid = "[myappid]"; fboptions.appsecret = "[myappsecret]"; fboptions.provider = new facebookauthenticationprovider() { onauthenticated = async context => { context.identity.addclaim( new system.security.claims.claim("facebookaccesstoken", context.accesstoken)); } }; fboptions.signinasauthenticationtype = defaultauthenticationtypes.externalcookie; app.usefacebookauthentication(fboptions);

asp.net-mvc asp.net-mvc-5 asp.net-identity asp.net-identity-2

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -