私はasp.net / Windows統合認証を使用して、ユーザー(社内)を別のページに「リダイレクト」しています。私が持っているWeb設定で
<authentication mode="Windows"/>
<authorization>
<deny users="?"/>
</authorization>
メインページの Load イベントで、私はこのコードを持っています:
Dim User As System.Security.Principal.IPrincipal
Dim username As String
User = System.Web.HttpContext.Current.User
username = User.Identity.Name 'Here i'm getting something like MyDomain\MyName
If User.Identity.IsAuthenticated Then
'goto main page
else
'goto another page (where to login)
'and print a label like "Welcome " + username + " to my webpage"
end if
問題は、ユーザーとブラウザが異なると、動作が異なることです。例えば
- Internet Explorer 8、9 は問題なく動作します。ユーザー名を聞かれません。
- クロムもうまく機能します
- Firefox: firefox からユーザー名とパスワードを聞かれます ( MyCompanyDomain\MyName のようなものとパスワードを入力します)
私は何か間違っていますか?