简体   繁体   English

使用ASP.NET用户帐户登录的外部数据库

[英]External Database for login with ASP.NET User Accounts

I uploaded my ASP.NET MVC site to the hosting platform https://my.gearhost.com , but I am unsure as to how I can enable user account functionality to the site. 我将ASP.NET MVC网站上传到托管平台https://my.gearhost.com ,但是我不确定如何为该网站启用用户帐户功能。

I can access my MySQL Database through my site, which also hosted on gearhost with no trouble, but how do I make the DefaultConnection DB in ASP.NET external? 我可以通过我的站点访问我的MySQL数据库,该站点也毫无问题地托管在gearhost上,但是如何在ASP.NET外部创建DefaultConnection DB?

Upon going to the login page i receive this message: 进入登录页面后,我收到以下消息:

"Use another service to log in. There are no external authentication services configured. See this article for details on setting up this ASP.NET application to support logging in via external services." “使用其他服务登录。没有配置外部身份验证服务。有关设置此ASP.NET应用程序以支持通过外部服务登录的详细信息,请参见本文。”

I tried going through the article, but it explains how to set up SMS and email Two-Factor Authentication. 我尝试浏览这篇文章,但是它解释了如何设置SMS和电子邮件“两因素身份验证”。 I am aware of the potential security issues regarding this, but this is for a simple school project. 我知道与此有关的潜在安全问题,但这是针对一个简单的学校项目。

This is the database in question: http://i.imgur.com/wfk1idY.png 这是有问题的数据库: http : //i.imgur.com/wfk1idY.png

I'm sure there's an easy way to make this work, but I haven't been able to find a solution. 我敢肯定有一种简单的方法可以完成这项工作,但是我还没有找到解决方案。

Please let me know if I am misunderstanding your question. 如果我误解了您的问题,请告诉我。

You have a ConnectionString that you used for your local development which works locally, but once you deployed to your server it no longer works. 您有一个用于本地开发的ConnectionString,它可以在本地工作,但是一旦部署到服务器,它就不再工作。

If this is the case you need to add the following to your Web.Release.config file 如果是这种情况,则需要将以下内容添加到Web.Release.config文件中

<connectionStrings>
    <add name="DefaultConnection"
      connectionString="<ConnectionString from hosting provider>;"
      xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
 </connectionStrings>

Be sure to drop in the correct connection string. 确保输入正确的连接字符串。 This will be provided by your hosting provider. 这将由您的托管服务提供商提供。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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