// 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)); } }