コード例 #1
0
        internal static CustomerIdentity GetUserFromEmailAddress(string emailaddress)
        {
            var identity = new CustomerIdentity("Claims");
            identity.AddClaim(new Claim("emailaddress", emailaddress));

            return identity;
        }
コード例 #2
0
        public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
        {
            const string emailaddress = "emailaddress";

            var identity = new CustomerIdentity(context.Options.AuthenticationType);

            identity.AddClaim(new Claim(emailaddress, context.UserName));


            context.Validated(new AuthenticationTicket(identity, null));
        }