コード例 #1
0
		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);
		}
コード例 #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";
            }
		}
コード例 #3
0
 public LoginView()
 {
     _authenticationStateChecker = new AuthenticationStateChecker(this);
 }
コード例 #4
0
 public Authentication()
 {
     UseMockData = false;
     IsDebug = false;
     _authenticationStateChecker = new AuthenticationStateChecker(this);
 }