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); }
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); }
public LoginView() { _authenticationStateChecker = new AuthenticationStateChecker(this); }