2011-03-23 3 views
0

개인 키는 우리가 가지고,

우리 제 awared asp.net 사이트와 ADFS 서버 그래서이 사이트

에 대해 구성한 이러한 문제를 가지고 ADFS2.0 응답시 교환의 KeySpec를 지원하지 않습니다 - 우리는 우리의 웹 응용 프로그램을 실행 - ADFS 서버로 인증을 위해 이동하고 웹 사이트로 다시 이동 - 결과로 우리는

**System.NotSupportedException: The private key does not support the exchange KeySpec. 
Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
Stack Trace: 
[NotSupportedException: The private key does not support the exchange KeySpec.] 
    System.IdentityModel.Tokens.X509AsymmetricSecurityKey.DecryptKey(String algorithm, Byte[] keyData) +237615 
    System.IdentityModel.Selectors.SimpleTokenResolver.TryResolveSecurityKeyCore(SecurityKeyIdentifierClause keyIdentifierClause, SecurityKey& key) +378 
    Microsoft.IdentityModel.Tokens.EncryptedSecurityTokenHandler.ReadToken(XmlReader reader) +253 
    Microsoft.IdentityModel.Tokens.SecurityTokenHandlerCollection.ReadToken(XmlReader reader) +105 
    Microsoft.IdentityModel.Web.TokenReceiver.ReadToken(String tokenXml, XmlDictionaryReaderQuotas readerQuotas) +282 
    Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.SignInWithResponseMessage(HttpRequest request) +312 
    Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args) +1099462 
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171** 

윈도우 로그가이 시간에 우리는 경고가 있음을 보여줍니다 사이트의 URL과 오류 서버 페이지가 - 내가 완전히 errorl과 함께 corelated 제안 톰 서버 오류 페이지가 비어있는 사용자와 IsAuthenticated는 = 거짓과

Log Name:  Application 
Source:  ASP.NET 2.0.50727.0 
Date:   3/23/2011 2:05:50 PM 
Event ID:  1309 
Task Category: Web Event 
Level:   Warning 
Keywords:  Classic 
User:   N/A 
Computer:  machine-name 
Description: 
Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 3/23/2011 2:05:50 PM 
Event time (UTC): 3/23/2011 2:05:50 PM 
Event ID: 356af0be20744d15bba97111f6bbd475 
Event sequence: 7 
Event occurrence: 6 
Event detail code: 0 

Application information: 
    Application domain: /appl-domain/ClaimsAwareWebAppWithManagedSTS-1-129453622903756000 
    Trust level: Full 
    Application Virtual Path: /ClaimsAwareWebAppWithManagedSTS 
    Application Path: C:\tools\AdvantageSso\Using Managed STS\ClaimsAwareWebAppWithManagedSTS\ 
    Machine name: machine-name 

Process information: 
    Process ID: 3840 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 

Exception information: 
    Exception type: NotSupportedException 
    Exception message: The private key does not support the exchange KeySpec. 

Request information: 
    Request URL: https://app-url/ClaimsAwareWebAppWithManagedSTS/default.aspx 
    Request path: /ClaimsAwareWebAppWithManagedSTS/default.aspx 
    User host address: host-name 
    User: 
    Is authenticated: False 
    Authentication Type: 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 

Thread information: 
    Thread ID: 10 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace: at System.IdentityModel.Tokens.X509AsymmetricSecurityKey.DecryptKey(String algorithm, Byte[] keyData) 
    at System.IdentityModel.Selectors.SecurityTokenResolver.SimpleTokenResolver.TryResolveSecurityKeyCore(SecurityKeyIdentifierClause keyIdentifierClause, SecurityKey& key) 
    at Microsoft.IdentityModel.Tokens.EncryptedSecurityTokenHandler.ReadToken(XmlReader reader) 
    at Microsoft.IdentityModel.Tokens.SecurityTokenHandlerCollection.ReadToken(XmlReader reader) 
    at Microsoft.IdentityModel.Web.TokenReceiver.ReadToken(String tokenXml, XmlDictionaryReaderQuotas readerQuotas) 
    at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.SignInWithResponseMessage(HttpRequest request) 
    at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args) 
    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

일부는 그래서 우리가 인증 산부인과 ADFS 합격을하지 못하거나 요청한 사이트의 현재 결과를 보여주고 있음을 의미합니까 ... 매우 혼란

그래서 불행하게도 나는이 지역에서 큰 전문가가 아니며 그 주와 함께 싸우고있다.

아무도 내가이 문제를 해결할 수 있도록 도와 줄 수 있을까?

덕분에 여기 일어날 것 같다 얼마나 많은

답변

1

은 AD의 FS에서 파티 신뢰 의지가 사용하는 일부 인증서 (의 공용 부분)의 토큰을 암호화하도록 구성되어 있다는 점이다. 그렇게하면 웹 응용 프로그램이 동일한 인증서의 개인 키를 사용하여 암호 해독을 시도합니다.

그러나 인증서는 '키 교환'을 지원해야하며 사용자의 오류 메시지가 표시되지 않습니다. 인증서를 어디에서 가져 왔는지는 알 수 없지만 IX509Enrollment을 사용하여 Windows COM을 통해 프로그래밍 방식으로 생성하는 경우 IX509PrivateKey에서 XCN_AT_KEYEXCHANGE으로 KeySpec을 설정해야합니다.

당신이 옳은 것을 얻으려면, 인증서가 '문서 서명'을 지원하는지 확인해야합니다. 이를 위해서는 IX509ExtensionEnhancedKeyUsage에 XCN_OID_KP_DOCUMENT_SIGNING 또는 1.3.6.1.4.1.311.10.3.12가 포함되어 있어야합니다.

위의 COM 인터페이스 뒤에있는 COM 클래스 이름은 IX509EnrollmentWebClassFactory::CreateObject 페이지에 설명되어 있습니다.

+0

감사 ... 일하기 시작 ... 인증서가있는 공황 상태와 혼란스러운 작업을했습니다 ... 귀하의 대답은 제가 수행 한 개요를 설명하고 올바른 인증서를 제출하도록 요구합니다 !!! –

0

또한 인증서를 처리하는 (서비스) 사용자가 로컬 컴퓨터에서 인증서에 액세스하는 데 충분한 권한이 있는지 확인해야합니다. 그게 내 문제 였어.