Sharepoint 2010 Foundation Forms authentication - forms-authentication

I've followed through this(http://goo.gl/1LTX) guide to setup FBA in SP 2010, but I get an error...
Note: I have enable WCF error messages
Cannot get Membership Provider with name wss_fba. The membership provider for this process was not properly configured. You must configure the membership provider in the .config file for every SharePoint process.
Any ideas?
I've checked the config and the default for membership and roles is correct as I have setup in IIS 7.
<membership defaultProvider="wss_fba" />
<roleManager defaultProvider="wss_roles" />

You need to add your own membership provider to the web.config file of the SecurityTokenServiceApplication. You can do that either by hand (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebServices\SecurityToken) or by IIS manager (open up SharePoint Web Services and modify the providers in the SecurityTokenServiceApplication webapp).

Related

Publishing from Visual Studio 2015

I am trying to publish my ASP.NET 5 MVC6 application to godaddy server from Visual Studio 2015. I have imported publish profile from my server and I am able to validate the connection. However, when I publish my app I have the following error:
ERROR_USER_UNAUTHORIZED
Web deployment task failed. (Connected to the remote computer
("XXXXXXX") using the Web Management Service, but could not authorize.
Make sure that you are using the correct user name and password, that
the site you are connecting to exists, and that the credentials
represent a user who has permissions to access the site.
The credentials are valid, I can publish VS2013 sample project from VS2015, but I can not publish VS2015 sample project as well as my app from VS2015 with the same credentials.
The user is an admin on the server.
The first thing you need to check is if GoDaddy supports 4.5.1 on their server. Once this is confirmed? We can start working!
Helios (the shim between IIS and ASP.NET 5) requires at least 4.5.1 to run so this is why it's essential.
Only thing missing is running a dnu publish and making sure that you have a web.config with this section in it:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
If it doesn't work, I would get in touch with GoDaddy for some support. If they do not support the latest version of the framework, you might have to revert to MVC 5 or switch to azure-web-sites if you really want to enable asp.net-mvc-6.

How to deploy ASP.NET MVC 4 application using localDB to local IIS on Windows 7?

When I try to run my ASP.NET MVC 4 application using Local IIS on Windows 7 with Visual Studio 2013. I run into the following error when the application tries to connect to localDB\v11.0
Server Error in '/' Application.
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not
found or was not accessible. Verify that the instance name is correct
and that SQL Server is configured to allow remote connections.
(provider: SQL Network Interfaces, error: 50 - Local Database Runtime
error occurred. Cannot create an automatic instance. See the Windows
Application event log for error details. )
The 2 event logs are
Unexpected error occurred while trying to access the LocalDB instance
registry configuration. See the Windows Application event log for
error details.
and
Cannot get a local application data path. Most probably a user profile
is not loaded. If LocalDB is executed under IIS, make sure that
profile loading is enabled for the current user.
Most solutions I found online references this post: http://blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-1-user-profile.aspx
The only difference I see between the described situation and my situation is that the described error code is 0 whereas my error code is 50. However, the proposed solution does not work for me.
I cannot get past this error even if I set modify setProfileEnvironment to true and I've spent hours of time playing around with different processModel parameters and application pools.
I was also suffering from same problem, but there is a solution for it.
Go to the IIS server, and then to the application pool from which your application is running. In the advanced settings of the application pool there is a "Process Model" option, under which there is an "Identity" option. This is by default the application pool identity. Change it to Local System, and you're done.
And Remember to Put App_Data Folder their in WWW folder of IIS server
Try this,this will solve your problem:
Edit the applicationHost.config file found in %windir%\system32\inetsrv\config\ specifically the ApplicationPools section.
Change the IdentityType to NetworkService to use newly created database.
<add name="ASP.NET v4.0" managedRuntimeVersion="v4.0">
<processModel identityType="NetworkService" loadUserProfile="true" setProfileEnvironment="true" />
</add>
Make sure that the application pool uses an identity that has access to the desired instance of the LocalDB.
Then disable ASP.NET Impersonation in Authentication settings of the application. Otherwise, application uses IUSR_MachineName account to access the database.
This setup may not be suitable for production environment but could be sufficient for database and application development.
Maybe this will help someone. I had the same problem installing an empty Epise3rver 7.5+ version but it was clear it did not have to do with any settings or configurations since my colleagues did not have this problem. I ended uninstalling all MSSQL-related applications and reinstalled MsSQL Express 2014. And it worked! I tried before to install 2014 but it didn't change anything so as said I then uninstalled everything MsSQL-related before installing 2014 again. Hope it helps.
Using MVC 5.2.3.0 I had a similar issue...added this to my web.config.
<!-- Configure the Sql Membership Provider -->
<membership defaultProvider="SqlMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add
name="SqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlConn"
applicationName="MembershipAndRoleProviderSample"
enablePasswordRetrieval="false"
enablePasswordReset="false"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="true"
passwordFormat="Hashed" />
</providers>
</membership>
https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-use-the-aspnet-membership-provider

Kerberos double-hop in ASP.NET 4.0 & SQL2008R2

I have an ASP.NET 4.0 application within which I need to forward the authentication to the database.
For the purposes of this request for assistance, lets call the web server "app1" and the database server "sql1".
The SQL2008R2 database service is running as a named instance "SQL2008R2" under a custom domain account "SqlServer". The server is running Windows Server 2008 R2 Enterprise Edition.
I have created an SPN for this...
setspn -a MSSQLSvc/sql1.mydomain.local:SQL2008R2 SqlServer
The ASP.NET application is running under an application pool using a custom domain account "WebApplicationUser", in Integrated Pipeline mode. It is currently running on my laptop running Windows 7 Enterprise, but will eventually be hosted on Windows Server 2008 R2 Standard Edition.
I have created 2 SPN's for the application (on the Windows 7 machine that I am currently running from)...
setspn -a http/app1 WebApplicationUser
setspn -a http/app1.mydomain.local WebApplicationUser
Within Active Directory users and Computers, I have selected the "WebApplicationUser" account and I have enabled constrained delegation to "MSSQLSvc/sql1.mydomain.local:SQL2008R2" using any protocol (I have also tried using Kerbero only).
The Application is setup in IIS 7.5 and the authentication is set to disable Anonymouse, Basic, Digest and Forms whilst enabling "ASP.NET Impersonation" and "Windows". The Windows authentication has "Extended protection" turned off and "Kernel-mode authentication" enabled. The providers are "Negotiate" and "NTLM" in that order.
The ASP.NET application uses EF, and the connection string is configured to use integrated security...
<connectionStrings>
<add name="MyContext"
connectionString="metadata=res://*/Data.MyModel.csdl|res://*/Data.MyModel.ssdl|res://*/Data.MyModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=sql1.mydomain.local\sql2008r2;Initial Catalog=MyDatabase;Persist Security Info=false;Integrated Security=True;MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
</connectionStrings>
My web config specifies both Windows authentication and impersonation, since I a using async pages, I have also enabled inpersonation policy flowing...
<runtime>
<alwaysFlowImpersonationPolicy enabled="true" />
</runtime>
<system.web>
<authentication mode="Windows" />
<identity impersonate="true" />
</system.web>
If I log on locally (on "web1") and browse to the application (using IE), this all works - but this does not involve the double hop that I am trying to resolve.
If I log on to another machine and then browse to the application using IE, or I browse from the local machine using FireFox, this does not work - note: FireFox does prompt me for the login details. The connection to the database fails with "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'"
Unlike a lot of the articles (and here might be part of the problem), I am not using any custom code to impersonate the user. It is my understanding that the impersonation will be applied across the board to the application by the web.config settings above. All I do is to open the connection and then close it again when I am finished with it.
I have obviously missed a step (or two), but having looked at all of the documentation that I can find (and there has been a lot), I still cannot find what that step is. It does not help that 99% of the documentation that I can find is actually related to IIS6 and Windows 2003 but the principles should remain the same.
Has anybody suceeded in getting such a configuration to work on Windows 7 and/or Windows Server 2008?
Checklist for Double Hop issues {IIS and SQL Server}
http://blogs.technet.com/b/taraj/archive/2009/01/29/checklist-for-double-hop-issues-iis-and-sql-server.aspx
http://www.phishthis.com/2009/10/24/how-to-configure-ad-sql-and-iis-for-two-hop-kerberos-authentication-2/
http://support.microsoft.com/kb/810572
IIS to SQL Server kerberos auth issues
When you configure the SPNs for SQL Server, we have found that we need to include the PORT on which SQL Server listens (1433).
You should download and use Brian Booth's DelegConfig v2 tool to help you setup the correct configuration settings. http://blogs.iis.net/brian-murphy-booth/archive/2009/04/22/delegconfig-v2-beta.aspx
It will basically hold your hand the whole way through the process. We've found the tool to be invaluable.

windows azure AspNetSqlMembershipProvider

I am working on an ASP.NET application that uses the AspNetSqlMembershipProvider for the authentication mechanism.
I am transferring the application to a cloud application in order to deploy it on windows azure.
Do I have to change the authentication mechanism that I use or will the AspNetSqlMembershipProvider will work normally?
Don't change the authentication mechanism, just use the Universal Providers and it will work normally.
You have no need to change the Authentication Mechanism for the reason of deployment. Just make the local machine database scripts to run on the sql azure database. Everything should be work same as you are doing authentication on local development machine.
Check these links to know regarding this deployment of sql authentication or database script etc:
Trying to deploy Asp.Net Memebership database to SQL Azure
Updated ASP.net scripts for use with Microsoft SQL Azure
After installing the scripts, just change the connection string in the webconfig that provide the authentication through database.
<connectionStrings>
<add name="LocalSqlServer"
connectionString="you azure connection string"
providerName="Provider..." />
</connectionStrings>

Connection string setting while deployment

I have ASP.NET project and attached mdf database.I want to deploy it to remote server.I have just ftp account.The project works well on my local but ı had problem while deploying.I changed my connection string like. Please help me what is the problem ?
<add name="libraryConnectionString"
connectionString=" Server =.\SQLExpress;
AttachDbFilename= myusername#ftp.myserver.com/App_Data/LIBRARY.mdf;
Integrated Security=SSPI;
User Instance=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
You have to create a Ms-Sql server database (remote) along with user via control panel or you may ask to your hosting provider to create a database and user. Once database is created then you may execute your script (You may use Visual Studio Database Publishing wizard) and construct a new connection string for your web-app.
Have a look at MSDN article - Deploying a Database by Using the Database Publishing Wizard
The Database Publishing Wizard in Visual Studio enables you to deploy
a SQL Server database (both schema and data) to a hosting environment.
You can run the wizard by right-clicking a database in Server Explorer
and then clicking Publish to provider.

Resources