2013-04-05 2 views
18

ASP.NET MVC 응용 프로그램에서 내 홈 페이지를 가져 오려고하면이 예외가 발생합니다.페더레이션 인증 및 "암호화 작업 중 오류가 발생했습니다"

[CryptographicException :. 에러가 암호화 동작 중에 발생]
System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors (Func`2 FUNC 바이트 [] 입력) 246
System.IdentityModel .Services.MachineKeyTransform.Decode ( 인코딩 [] 바이트) 191
System.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms (바이트 [] 쿠키 부울 발신) 173
System.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken (XmlRe ADER 리더 SecurityTokenResolver tokenResolver) 756
System.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken (바이트 [] 토큰 SecurityTokenResolver tokenResolver) +100
System.IdentityModel.Services.SessionAuthenticationModule.ReadSessionTokenFromCookie (바이트 [] 부터 SessionCookie) 1,164
System.IdentityModel.Services.SessionAuthenticationModule.TryReadSessionTokenFromCookie (SessionSecurityToken & sessionToken) 287
System.IdentityModel.Services.SessionAuthenticationModule.OnAuthenticateRequest (개체 송신자있는 EventArgs있는 EventArgs) 231
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80 (IExecutionStep 단계, 부울 & completedSynchronously) 내가 뭔가를 이해하는 바로는 165

SessionAuthenticationModule에 대한 쿠키가 잘못되었습니다. 쿠키를 삭제하면 (이미 여기에 명시된 바와 같이 Federated Authentication on Azure) 작동합니다. 제가하고 싶은 것은 무슨 일이 일어나고 있는지, 어떻게 예외를 발견하고 문제를 해결할 수 있는지 이해하는 것입니다.

+0

어떻게 쿠키를 발행합니까? –

+0

귀하의 앱이 하늘빛에 있습니까? –

+0

@WiktorZychla : 이전 빌드에서 가져온 것이고 브라우저에 캐시되어 있습니다. – Dave

답변

16

쿠키가 발행 될 때 현재 machineKey를 사용하여 암호화 된 보안 토큰을 포함합니다. 이전 빌드의 쿠키가 서버로 다시 보내지면 SAM (더 정확하게는 토큰 처리기)이 오류를 발생시키는 machineKey의 새 값을 사용하여 해독하려고 시도합니다. 관련 게시물 (Federated Authentication on Azure)에서 내 대답을 확인하여 오류를 완화하십시오. HTH

+0

내 문제에 대한 빠른 해결, 감사합니다! –

3

나는 똑같은 문제에 직면했다. 방금 ​​브라우저의 쿠키캐시 데이터을 모두 삭제했으며 문제가 해결되었습니다.

+0

작동하지만 문제가 다시 발생합니다. –

+0

제 경우에는 고칠 때부터 괜찮습니다. –

+0

글쎄, 어떻게 고쳐 봤어? –

관련 문제