public CreateToken ( System.IdentityModel.Tokens.SecurityTokenDescriptor tokenDescriptor ) : System.IdentityModel.Tokens.SecurityToken | ||
tokenDescriptor | System.IdentityModel.Tokens.SecurityTokenDescriptor | The token descriptor. |
return | System.IdentityModel.Tokens.SecurityToken |
private static SecurityToken CreateToken(AccessSecurityTokenHandler handler) { var descriptor = new SecurityTokenDescriptor { AppliesToAddress = "http://tecteacher.thinktecture.com/videos/1", Lifetime = new Lifetime(DateTime.Now, DateTime.Now.AddMinutes(60)), SigningCredentials = GetSigningCredential(), TokenType = AccessSecurityToken.TokenTypeIdentifier, Subject = new ClaimsIdentity(new List<Claim> { new Claim(WSIdentityConstants.ClaimTypes.Name, "bob") }) }; var token = handler.CreateToken(descriptor); return token; }