简体   繁体   中英

WCF Username/Password Prompt

This is kind of a dumb question, but I can't seem to find the answer on google.

I'd like to protect my REST enabled WCF service WSDL with https username and password logon (like my Linksys router prompts me to enter when I navigate to 192.168.1.1).

I'm already using a BasicAuthenticationRequestInterceptor with the WCF Rest Starter Kit...and that allows me to have the client use classic http header based authentication...but that doesn't seem to get me to the point where the user is prompted to enter a username and password when they go to http://mysite.com/services/myserivce.svc ...

How do I do this?

Thanks.

If you don't want to publish your WSDL then you can remove [serviceMetadata] element from your configuration. As marc_s suggested, you may use IIS provided security (Basic Authentication/Windows Authentication etc) to secure your URLs. Yet another approach would be to expose your metadata across secure end-point. See this MSDN article for the same: Custom Secure Metadata Endpoint . There, certificate has been used but I am sure you can modify it to support basic authentication.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM