Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

DpapiDataProtectionProvider Create Method

$
0
0
        public static UserManager<CustomUser> CreateUserManager(CustomSecurityDbContext context, bool withProvider = false)
        {
            var manager = new UserManager<CustomUser>(new UserStore<CustomUser>(context));
            manager.UserValidator = new UserValidator<CustomUser>(manager) { AllowOnlyAlphanumericUserNames = false };
            if (withProvider)
            {
                var provider = new Microsoft.Owin.Security.DataProtection.DpapiDataProtectionProvider("MvcApplication");
                manager.UserTokenProvider = new Microsoft.AspNet.Identity.Owin.DataProtectorTokenProvider<CustomUser>(provider.Create("MvcApplication"));
            }

            return manager;
        }

on the manager.UserTokenProvider line, the provider.Create method takes in a string which is described by intellisense as params string purposes.

What string parameter do I pass in this constructor? I don't get what it does. 


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>