理論的には同一の2つのWebサーバーがありますが、AzMan認証チェックを実行すると異なる結果が生成されます。
両方のマシンで同じWebサイトが実行されています(文字通り同じWebサイトです。一方から他方にXCOPYされており、同じサービスアカウントで実行されています)。このWebサイトが行うのは、AzManデータベース(別のSQLサーバー上にある)に対して承認チェックを実行することだけです。
ただし、動作中のWebサイト(WebA)ではこのチェックが返さ0
れ(つまり「ユーザーは承認されています」)、壊れたWebサイト(WebB)ではこのチェックが返されます5
(つまり「ユーザーは承認されていません」)。0
私たちは両方のウェブサイトで期待しています。同じユーザーが同じPCから両方のWebサイトにアクセスしています。
誰かが私たちがチェックできることについて何かアイデアがありますか?
環境の詳細
- Windows Server 2008 R2
- 同じADドメイン
- IIS 7.5
- .NET 3.5
- AzManデータベースは、SQL Server 2005 / Windows Server2008R2で実行されます。
コード
AzAuthorizationStoreClass authStore = new AzAuthorizationStoreClass();
// initialise the store
authStore.Initialize(0, "mssql://Driver={SQL Server};Server={OURDBSERVER};Trusted_Connection={Yes};/OURDATABASE/OURAPPLICATION", null);
// open the store
IAzApplication2 authApp = authStore.OpenApplication2("OURAPPLICATION", null);
// get the identity of the user NOT the service account
WindowsIdentity identity = Thread.CurrentPrincipal.Identity as WindowsIdentity;
// and from that derive the token
ulong userToken = (ulong)identity.Token.ToInt64();
// get the context based on the token
IAzClientContext3 clientContext =
(IAzClientContext3)authApp.InitializeClientContextFromToken(userToken, null);
// get the operation object based on the id
IAzOperation2 azManOperation = (IAzOperation2)authApp.OpenOperation(operationId, null);
// generate an audit identifier
string auditIdentifer =
string.Format("{0}{1} : O:{2}", "{the_correct_id}", identity.Name, operationId);
uint accessResult = clientContext.AccessCheck2(auditIdentifer, string.Empty, azManOperation.OperationID);
return accessResult.ToString();
どうもありがとう、
RB。