Exemple #1
0
 private void ValidateAuthState()
 {
     // Check authentication state
     if (IsAuthenticated)
     {
         ThrowHelper.AlreadyAuthenticated();
     }
     if (!IsAuthenticationPending)
     {
         ThrowHelper.NoAuthenticationRequested();
     }
 }
Exemple #2
0
        private void ValidateAuthReqStatus(string authKey)
        {
            // check authentication state
            if (IsAuthenticated)
            {
                ThrowHelper.AlreadyAuthenticated();
            }

            if (IsAuthenticationPending)
            {
                ThrowHelper.AuthenticationAlreadyRequested();
            }

            // check authKey
            if (string.IsNullOrEmpty(authKey) && !AllowAnonymous)
            {
                ThrowHelper.AuthenticationAsAnonymousForbidden();
            }
        }