I'm new to WCF. I have a client that establishes a connection to a WCF service by sending a username and password as a token. The service has a custom token authenticator which extends the UserNameSecurityTokenAuthenticator class to implement custom validation logic.
I want to figure out what the client IP address is from the server side and have it available in my custom token authenticator class
I've tried to add message inspectors and endpoint inspectors but these points are never hit.
I have a customServiceCredentials class that extends the ServiceCredentials class. Is this where I can intercept the message before authentication.
I know using OperationContext I can get the clientIp, however I just don't know where to intercept the message before it hits the token authenticator
I think the BeforeSendRequest method can get the clientip before you send the request. But after your testing, this method won't work.
This method can be tried. This method was discovered on a post that is a bit old but I thought you could give it a try.
This is the original post:Obtaining client IP address