I've got WCF web services hosted in an ASP.NET application. For the asp.net
part I'm using Forms authentication for the web services I want to use
Windows authentication. After configuring this the caller of the
service is getting redirected to the login page of the web app. I have tried to
exclude the folder hosting the WCF web services but could not get it working.
Can this be configured or do I have to host my WCF as separate site in iis?
Edit
After some more googling I found that its is posible but its not as easy as i would like it to be :) The part I especialy dislike is that my app has to have this wrapper in GC or app has to have full trust permisions :(
http://mvolo.com/blogs/serverside/archive/2008/02/11/IIS-7.0-Two_2D00_Level-Authentication-with-Forms-Authentication-and-Windows-Authentication.aspx
Ill try it and let you know how it went.
Did you setup your WCF bindings correctly in the web.config?
Here's a link on how to configure this:
http://www.codeproject.com/KB/WCF/WCFBasicHttpBinding.aspx
Do you have the ASP.NET compatibility mode disabled for the WCF Services ?. If it's enabled, ASP.NET will try to authenticate the user first. Otherwise, it should go straigh to WCF.
The solution I googled works, but Im not going to use it because application I made is not supposed to have full trust permisions and I also dont want to place the wrapper in GAC. So the solution I ended up with is split WS and asp.mvc app into two sites on iis.
Related
Can someone explain to me how to achieve single-sign on? I have an MVC ASP.NET core web app(let's say www.internalsite.com), how can the app get the user credentials automatically and authenticate etc.? I need a very clear explanation on how to do it.
By using www.internalsite.com I guess you are talking about a site on an intranet, right? How are you hosted? IIS in front of Kestrel? If so, then it's quite straightforward, you just need to configure IIS to foward the Windows identity (coming from a Kerberos token usually) by setting the proper value in the web.config: forwardWindowsAuthToken="true" as explained here: Asp.net Core Web API - Current user & Windows Authentication and make sure you have a controller/action protected by an [Authorize] tag so that the IIS middleware is challenged and set the identity of the request as explained here: NTLM authentication on specific route in ASP.NET Core No much code to write in your project. If you are using another hosting setup, WebListener, it is pretty much the same.
Another solution, would be to do SSO by client certificate which has the advantage of working cross domain, but SSO by Kerberos is by far easier and usually doing a good job on an intranet.
I am facing a problem and I don't know if my solution is do-able. I have an ASP.NET MVC app which do request to a WCF service (both are hosted in IIS).
In the web app, I identify each user by Windows authentification and get their groups, roles, etc. from active directory.
BUT according to user groups, I need to change some settings in my WCF service. In my idea I'm looking a way to change the settings of WCF service (it need to be in the web.config, mandatory) and I'm really not sure if it's possible, because I think each call to the WCF should create a new instance of web.config, but for now it's just a simple file.
What do you think ?
Thanks !
We got Mvc4 Web application on server1 calling our Restfull Mvc4 Web Apis on server2 both hosted on IIS 7.5. This architechture works fine. When we put each application on loadbalanced servers the web application works fine however web api project doesnt run on the second server on the loadbalancer. We have just cloned the environments so they both have identical code and configuration but the servernames and mappings.
Is there any extra configuration for hosting MVC4 Web Api applications on loadbalancer?
has anybody actualy got MVC4 Web Api working on loadbalanced environment?
thanks,
Is there any extra configuration for hosting MVC4 Web Api applications on loadbalancer?
Not necessary if your Web API is stateless and you are not using any ASP.NET session. If you are using an ASP.NET session you might need to use an out-of-process session state instead of the default in-memory.
Has anybody actualy got MVC4 Web Api working on loadbalanced environment?
Yes, I have.
I have found the problem! The damn problem was our firewall blocking the web request
I'm wondering how to run a Wordpress and virtual MVC application under the WP on Azure. I found a lot of articles about this but it is not working and Azure SDK is changing all the time, there is no actual informations.
Am I able to connect to the Azure Web Role IIS server remotely?
If you have any questions, please ask before answering.
Update by Jim O'Neil comment
Yes I mean ASP.NET MVC. "Not working" means taht WP on Azure by this and ASP.NET MVC app works separatelly but together doeasn't. When I try add ASP .NET MVC as VirtualApplication by this tutrial VM on Azure is always in Busy state.
I need have an WP deployed on my domain example.com and ASP.NET MVC app at example.com/mvcapp. This should work on the Azure platform and could be reached by Virtual application feature of IIS. Then I hope that the Azure Web role is usable for this.
Do you have any idea?
If you really want to run wordpress website as www.example.com and ASP.NET MVC app as www.example.com/mvcapp then you could need to be little more creative to get it working. It is a doable task but need good understanding of Windows Azure platform, how Web Role works as well as PHP/WordPress knowledge.
I can point out some ideas on how you could do it but you would need to venture out to try and test. What you really need to create a ASP.NET Web Role with PHP support and have Wordpress configured to it. This could be done at runtime or you can put together worldpress along with the PHP itself so when you deploy your application whole wordpress is configured as package. Now in the same web role you add virtual diurectory and have MVC app running as application there.
Keep in mind that whole web role will have one single web.config so you would need to make it work with both ASP.NET PHP application and then MVC application. Tough task to handle these two and will take time to put together.
The other easier option is to have PHP running inside a ASP.NET MVC application and in the PHP folder setup your Wordpress application. This setup is easily configurable but it will change the location for wordpress and MVC app other way around.
Overall I really think you should rethink what you really want at the last because your objective just does not match with a need to have wordpress and ASP.NET MVC running together. If you just want to try for experiment, it sure is a great project and make you learn a lot.
This question is asked earlier # SO also but had same response i.e why?
I am not sure about on azure, but on IIS7 we have WP and the URL Rewriter setup as the default website and then deploy asp.net and ASP apps to virtual directories and turn off the URL Rewriter in those subdirectories. Works beautifully. Downside is that PHP runs like a dog on IIS compared to ASP/ASP.net. We are switching to using WP on LAMP and then continuing to run our ASP/.net apps on IIS7. Downside is that the WP after switch over may effect our SEO a little. IIS is www and WP will be ww3.
You might check your URL Rewrite rules if any.
You can create a website in Azure using a wordpress template VM.
You can also use http://wordpress.brandoo.pl/project/ which has an image available in Azure, this means you can use a SQL database rather than a MYSQL database which may help.
You can have one VM being your MVC app pointing to www.mydomain.com and you could have the worpress in a separate VM with say blog.mydomain.com
This would make maintenance easier I think
I have a .NET 4 application that runs as a windows service. It runs periodic tasks and provides WCF restful webservices. It already hosts a silverlight web page (via WCF) that allows a user to configure the service.
Now I have a requirement to provide information on HTML/java script pages (e.g. for browsers and platforms that don't support Silverlight). I can serve simple HTML and javascript pages through WCF but that becomes laborious very quickly. I'd like to use MVC2.
Is it possible to provide MVC2 web pages from within a windows service? Or at least use some of the functionality provided by MVC like routing and the view engine?
Or is it more trouble than it's worth and should I head down the path of a separate app hosted on IIS?
You can host the ASP.NET runtime in any type of application including a Windows Service using the CreateApplicationHost method. Although note that by doing this you lose the robustness, security, logging, etc... that a real web server such as IIS provides.
Since you're asking the question about what route to take, I'd host an MVC2 application in IIS. Why recreate a web server using WCF when IIS is already there - and since you're asking, it sounds like that's a viable option.
I agree with Darin's answer that you can host ASP.NET MVC2 in any application, but I think you're going to end up recreating a lot of plumbing that's already in place with IIS.
On the upside, if you go with serving up ASP.NET MVC2 resources in a WCF service application, it may end up rocking and you could have a nice application you can sell on the side. :)