Old username in Active Directory
I have WCF service with Windows authentication. To identify client user on the service side I'm using following code: ServiceSecurityContext.Current.PrimaryIdentity.Name
.
That returns me string in the form: 'domain\janedoe'.
Jane Doe became married and changed last name. Active Directory administrator also renamed her user id. So now she logs into A开发者_如何学GoD as 'domain\janesmith'.
My issue is that ServiceSecurityContext.Current.PrimaryIdentity.Name
still returns old one - 'domain\janedoe'.
Do you have some suggestions on where to start with this ?
There is some caching mechanism in Active Directory.
Maybe this link will help you link
I had a similar problem with a web app I was running in IIS 6. The only thing that would ever work for me to clear the cache was to restart the server. Our AD admin was completely unhelpful/out of his depth so I eventually just re-wrote the page to grab the sid. Then if I needed the username I would do an LDAP query on the sid to get the user name.
How about using Softerra LDAP Browser (the free version 2.6) to see what attributes are available and to see which field could have possibly been read from?
Then you could investigate further; maybe the change of her name did not cover all necessary attributes.
Addition:
Also, if you have multiple domain controllers that replicate their information, there could be some delay, until they all have up-to-date data.
精彩评论