1
로드 밸런서에서 내 사이트를 실행해야하므로 세션 토큰 처리기를 다음으로 대체해야했습니다.로드 밸런서를 사용하여 시작 및 신뢰 당사자
public class WebFarmSessionSecurityTokenHandler : SessionSecurityTokenHandler
{
public WebFarmSessionSecurityTokenHandler(X509Certificate2 protectionCertificate)
: base(CreateRsaTransforms(protectionCertificate))
{ }
private static ReadOnlyCollection<CookieTransform> CreateRsaTransforms
(X509Certificate2 protectionCertificate)
{
var transforms = new List<CookieTransform>()
{
new DeflateCookieTransform(),
new RsaEncryptionCookieTransform(protectionCertificate),
new RsaSignatureCookieTransform(protectionCertificate),
};
return transforms.AsReadOnly();
}
}
다음과 같이 web.config를 수정했습니다.
<microsoft.identityModel>
<service>
...
<securityTokenHandlers>
<clear />
<add type="MyAssembly.WebFarmSessionSecurityTokenHandler, MyAssembly"/>
</securityTokenHandlers>
...
</service>
</microsoft.identityModel>
내 희망은 내 신뢰 당사자가 어떤 노드에 액세스했는지 또는 어떤 상자가 인증을 시작했는지 상관없이 작동한다는 것이 었습니다.
현재 다음과 같이 표시됩니다. SecurityTokenHandler가 보안 토큰을 읽을 수 있도록 등록되지 않았습니다.
아이디어가 있으십니까?