コード例 #1
0
ファイル: Util.cs プロジェクト: leader001/Angel
        /// <summary>
        /// Get auth code for specified payload for use in SSO process.
        /// </summary>
        /// <param name="payload">Payload to sign</param>
        /// <returns>Specified payload signed with app key and hashed with SHA-1.</returns>
        public static String GetAuthCode(string payload)
        {
            // Get the app key setting.
            string applicationKey = ConfigurationVariable.GetValue(AppKeyVarName);

            String signedPayload = payload + "|" + applicationKey;

            String authCode = FormsAuthentication.HashPasswordForStoringInConfigFile(signedPayload, "SHA1").ToUpper();

            return(authCode);
        }
コード例 #2
0
 public void SetAuthenticationCookie(string userName, bool createPersistentCookie)
 {
     Authentication.SetAuthCookie(userName, createPersistentCookie);
 }
コード例 #3
0
 public void LogOff()
 {
     Authentication.SignOut();
 }
コード例 #4
0
 public void Logon()
 {
     FA.SignOut();
     Response.Redirect("/login.aspx");
 }