コード例 #1
0
        // GET: ClaimsImport
        public ActionResult Index()
        {
            var publicKey = HttpContext.Session.GetString("PassportPublicKey");

            if (String.IsNullOrEmpty(publicKey))
            {
                throw new Exception("Passport public key mmissing. User must be logged in with passport first.");
            }

            var claims = new List <Claim>();
            var claim  = new Claim
            {
                ClaimTypeId = "3",
                ClaimValue  = "*****@*****.**",
                CreatedOn   = DateTimeUtility.GetUnixTime(DateTime.UtcNow),
                ExpiresOn   = 0
            };

            claims.Add(claim);
            return(View(new ClaimsImportViewModel
            {
                ClaimsImportRequest = _service.CreateClaimsImportRequest(publicKey, claims)
            }));
        }