stop WCF from caching / re-using security tokens (SecurityContextToken)

南楼画角 提交于 2019-12-06 11:49:51

after a lot of research, and pouring through the WCF trace, and contacting Microsoft, i got to the bottom of this problem.

  1. when using message level security, WCF issues Security Context Token based authentication (SCT)

  2. this type of authentication simply relies on sticky session, no way around it.

  3. there is a setting which is supposed to disable it EstablishSecurityContext=false, but this does not work. after setting this i can see in a trace that SCT's are being used just as before (and i got someone at Microsoft to confirm i wasn't doing anything unusual here). There might be another dependency on this setting, but a senior MS engineer didn't know why this setting wasn't working either.

  4. this leaves a few options

    a. use "one shot" calls with Kerberos - i did not explore this because turning on kerberos in my scenario would have been a bigger headache

    b. use a custom binding with NTLM based auth - i tried this, but SCT's were still being used, so it didn't work for me

    c. use federated security with custom Token issuing service. This gives a finer control over how tokens are issued, but with unnecessary (in my case) overhead of having to manage this

    d. use basic http binding with TransportCredentialOnly security mode. this is nice because it stops SCT negotiation, while still passing a windows credential.

4.d was the easiest for me because i didn't have to do a lot of changes besides config. i am giving up wshttpbinding features, but so far this is ok because this conversation is happening within a trusted network.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!