private void ValidateAuthState() { // Check authentication state if (IsAuthenticated) { ThrowHelper.AlreadyAuthenticated(); } if (!IsAuthenticationPending) { ThrowHelper.NoAuthenticationRequested(); } }
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(); } }