Beispiel #1
0
 // GET: Private/Home
 public ActionResult Home()
 {
     if (Session["idToken"] == null)
     {
         return(RedirectToAction("Login", "Home"));
     }
     else
     {
         ViewBag.Title = "Home";
         //Accessing the tokens from the session.
         IdToken idToken = (IdToken)Session["idToken"];
         //Providing user information to the page.
         var user = new User()
         {
             DisplayName = idToken.GetDisplayName()
         };
         return(View(user));
     }
 }
Beispiel #2
0
 // GET: Private/MyProfile
 public ActionResult MyProfile()
 {
     if (Session["idToken"] == null)
     {
         return(RedirectToAction("Login", "Home"));
     }
     else
     {
         ViewBag.Title = "My Profile";
         //Accessing the tokens from the session.
         IdToken idToken = (IdToken)Session["idToken"];
         //Providing user information to the page.
         var user = new User()
         {
             DisplayName = idToken.GetDisplayName(),
             IdDomain    = idToken.GetIdentityDomain(),
             UserID      = idToken.GetUserId(),
             Issuer      = idToken.getIssuer(),
             Token       = idToken.getToken()
         };
         return(View(user));
     }
 }