c# - Determining the IP Address of the client in a WCF SOAP UserNamePasswordValidator -
we using custom usernamepasswordvalidator. allows consumer specify credentials in soap header follows:
<o:security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" mustunderstand="1"> <timestamp id="_0"> <created> 2013-04-05t16:35:07.341z</created> <expires>2013-04-05t16:40:07.341z</expires> </timestamp> <o:usernametoken id="uuid-ac5ffd20-8137-4524-8ea9-3f4f55c0274c-12"> <o:username>someusername</o:username> <o:password o:type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#passwordtext">somepassword </o:password> </o:usernametoken> </o:security>
we need start logging ip address of client, doing ip whitelisting/blacklisting. unfortunately not see how possible retrieve ip when in class. @ runtime both operationcontext.current , httpcontext.current properties null.
the correct answer turn on asp.net compatibility http context back. glad help.
Comments
Post a Comment