protected void Page_Load(object sender, EventArgs e)
        {
            var authenticationStateChecker = new AuthenticationStateChecker(this);

            if (!authenticationStateChecker.IsAuthenticated)
            {
                throw new AuthenticationException("You must be authenticated to view this page");
            }

            LoginStateLiteral.Text = string.Format("You are logged in as {0}", authenticationStateChecker.UserName);
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var authenticationStateChecker = new AuthenticationStateChecker(this);

            if (authenticationStateChecker.IsAuthenticated)
            {
                LoginStateLiteral.Text = string.Format("You are logged in as {0}", authenticationStateChecker.UserName);
            }
            else
            {
                LoginStateLiteral.Text = "You are NOT logged in";
            }
        }
 public Authentication()
 {
     UseMockData = false;
     IsDebug     = false;
     _authenticationStateChecker = new AuthenticationStateChecker(this);
 }
Exemple #4
0
 public LoginView()
 {
     _authenticationStateChecker = new AuthenticationStateChecker(this);
 }