Issues while calling Sitecore API - asp.net-mvc

I have used mvc 5 captcha in my sitecore 8.1 based web application.But after hardening the captcha was not visible.Does any one face this kind of issues.Please help.

If the captcha Image is not displaying on the WFFM form. I imagine the configuration settings required for the Captcha are no longer present after your actions.
You need to ensure the following settings are present in are in the web.config under the node configuration/system.webServer/handers if you're using iis7 or above
<add name="CaptchaImage" verb="*" path="CaptchaImage.axd" type="Sitecore.Form.Core.Pipeline.RequestProcessor.CaptchaResolver, Sitecore.Forms.Core" />
<add name="CaptchaAudio" verb="*" path="CaptchaAudio.axd" type="Sitecore.Form.Core.Pipeline.RequestProcessor.CaptchaResolver, Sitecore.Forms.Core" />
See this link for more information or how to complete it in IIs 6

Related

Icons are not loading in Internet explorer when i keep no-cache,no-store in cache control

We are implementing security in our application developed in ASP Net MVC aadn Kendo UI. The changes making issue in loading icons.
Code change: Web.config
<add name="Cache-Control" value="no-cache, no-store,max-age=0" />
<add name="Pragma" value="no-cache" />
I am losing icons(dropdown,filter - Kendo icons) in internet explorer after i deploy web.config in web server.
As part of security, I should have this change in place and application should up and running.
Please provide suggestions/solutions.
Note: Changes are working fine in my locla environment.

Publish Web App (MVC) to Azure (Blue azure screen)

I have been struggling for days now with this and do not understand neither can i find the cause of my problem. I have a ASP MVC web app with a Class library and the default web project, i am using Entity Framework.
I am getting this Azure blue default screen when publishing my app:
while when creating a new web app, also using entity framework i don't have this issue and the web app launches correctly to the Index page.
I do not understand what is happening and how i can fix this ...
I tried importing the profile from azure and also creating it from VS but same results ...
Any suggestion is welcome, thank you in advance!
Kind regards
So i started comparing the new web app that did work and my app which didn't and turns out these little sections in the Web.config where causing the issue:
<system.webServer>
<!--<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
-->
</handlers>-->
</system.webServer>
Don't know how they got there but comment those and it works ...
Case closed!

ASP.net configuration manager and outlook

i have been requested to change the authentication mode in my mvc 4 project to be windows authentication, and i was using the asp.net configuration manager.
for us, it will be a major change in the code, so is there any workaround to link our outlook active directory to asp.net configuration manager ?
Try the following setting
<appSettings>
<add key="EnableSimpleMembership" value="false" />
</appSettings>
follow the link for more details
http://www.mikesdotnetting.com/article/216/windows-authentication-with-asp-net-web-pages

Error in ASP.NET MVC 4 with Universal Providers

I created a fresh simple ASP.NET MVC 4 Internet Project, then I have created models with the ADO.NET Entity Data Model designer and then I have installed System.Web.Providers (Universal Providers) and configured Web.config in order to have two different data sources, both using SQL CE 4.0.
These are my connection strings:
<add name="DefaultConnection" connectionString="Data Source=C:\maindb.sdf" providerName="System.Data.SqlServerCe.4.0" />
<add name="MyEntitiesModelContainer" connectionString="metadata=res://*/MyEntitiesModel.csdl|res://*/MyEntitiesModel.ssdl|res://*/MyEntities.msl;provider=System.Data.SqlServerCe.4.0;provider connection string="Data Source=C:\myentities.sdf"" providerName="System.Data.EntityClient" />
The application works. But when I try to login, this is the exception I get:
To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".
I have also added <add key="enableSimpleMembership" value="true" /> in Web.config because someone on different forums solved the problem doing this. It wasn't my case, the same error remains.
Could anyone help me please?
ASP.NET MVC4 ships with simple membership, and simple membership works with SQL CE out of the box, you don't need (and in fact can't use) the universal providers with Simple Membership.
From this ASP.NET forum post:
Thanks for the hint. Now that I was able to see that the provider was
being hijacked, I added
<appSettings>
<add key="enableSimpleMembership" value="true" />
</appSettings>
Everything Seems to be working fine now.

ASP.NET MVC3 and Windows Auth on IIS keeps redirecting to /Account/Login

I'm running MVC3 and a windows auth web application. When I deploy to IIS6 it runs great until I hit a page that requires authentication. It then is auto-redirecting to /Account/Login when I have no trace of that in my application and my web.config is configured to windows auth.
Any ideas?
Here is my entire web.config file: http://pastie.org/1568510
Check whether you have WebMatrix.Data.dll and/or WebMatrix.WebData.dll deployed in the bin directory of your application. If they are there (and you know you don't use them) then try removing them and accessing a page that requires authentication.
In RTM try to add to <appSettings> in Web.config:
<add key="enableSimpleMembership" value="false" />
(Thx to Problem exclusively using Windows Authentication in ASP.NET MVC 3 Beta.)
Not sure if you still have the issue or not, but try adding
<add key="autoFormsAuthentication" value="false" />
to your web.config under appSettings. According to here and here, that should solve your problem.
Try override WebMatrix.dll default for login url by adding this to your appSettings (web.config) :
<add key="loginUrl" value="~/Account/LogOn"/>
WebMatrix.dll set the login Url to /Account/Login, if this key isn't set in the config file...
It works for me.
In RTM try to add to in Web.config:
<add key="enableSimpleMembership" value="false" />
The above post works. +1 Add this key before adding deployable dependencies.
I had the same issue in my MVC4 project, only my project has Anonymous Authentication disabled outright, so Windows Authentication is always required.
I have no WebMatrix.* in my bin folder, and adding the autoFormsAuthentication and enableSimpleMembership keys to appSettings didn't do it for me.
Instead, I had to comment out the following:
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
And replace it with this:
<authentication mode="Windows" />
That did the trick.
I was using nopCommerce 2.65 and had this issue.
I did not have any of WebMatrix.Data.dll nor WebMatrix.WebData.dll deployed in the bin folder, but adding
<add key="autoFormsAuthentication" value="false" />
<add key="enableSimpleMembership" value="false" />
in the web.config solved it.
Another way to override "login.aspx url redirection problem with MVC + IIS 7"... by adding this to your appSettings (web.config) :
<authentication mode="Forms">
<!--<forms loginUrl="~/Account/Login" timeout="2880" />-->
<forms loginUrl="~/Home" timeout="2880" />
</authentication>
...This resolved the problem for me
I fixed it this way
1) Go ot IIS 2) Select your Project 3) Click on "Authentication" 4) Click on "Anonymous Authentication" > Edit > select "Application pool identity" instead of "Specific User". 5) Done.
Make sure that all the authentication settings in IIS are correct.
For me the application that redirected to /Account/Login was running within a site that Anonymous authentication enabled. After disabling this in the site and enabling it for the application (together with Windows authentication) it was ok.
You can also go to the IIS on the server and go into Authentication modes and disable forms authentications.
This has me scratching my head in a demo. Embarassing.
I know this is a super old post. But I just ran across this after going through a tutorial on upgrading from MVC 4 to MVC 5. So I'm throwing it on just in case anyone else makes the mistake I did.
My issue ended up being that I accidently added 'Microsoft.AspNet.WebPages.WebData' to my project while upgrading my references.
Running "Uninstall-Package Microsoft.AspNet.WebPages.WebData" restored my authentication to it's previous glory.
In MVC for the 4.6 Framework this is done in 2 ways, the first is in the Web.Config as you would expect, the second one is done in the projectfile and is used to configure IIS Express:
<PropertyGroup>
..
<IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
<IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>
</Property
Will disable Windows authentication and use anonymous when developing but is not used for the deploying the application.

Resources