Note that there are some explanatory texts on larger screens.

plurals
  1. POConnecting to SQL Server Database with Windows Authentication?
    primarykey
    data
    text
    <p>When a user tries to connect to a SQL Server Database through Windows Authentication in my ASP MVC 3 app, with the following connection string:</p> <pre class="lang-xml prettyprint-override"><code>&lt;add name="btnintranetContext" connectionString="Data Source=BTN-SERVER;Initial Catalog=Intranet;Integrated Security=SSPI;MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/&gt; </code></pre> <p>They get the following error:</p> <pre class="lang-none prettyprint-override"><code>Cannot open database "Intranet" requested by the login. The login failed. Login failed for user 'User'. </code></pre> <p>I understand what this means, it means that I haven't given that user access to the database, but I want user's to be able to access the database without having to give them all access to it. I've tried specifying a specific Database user in my connection string like so:</p> <pre class="lang-xml prettyprint-override"><code>&lt;add name="btnintranetContext" connectionString="Data Source=BTN-SERVER;Initial Catalog=Intranet;User Id=mylogin;Password=mypassword;MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/&gt; </code></pre> <p>But I get a new error:</p> <pre class="lang-none prettyprint-override"><code>Login failed for user 'mylogin'. The provider did not return a ProviderManifestToken string. </code></pre> <p>But I know for definite that mylogin has access to the database because when I try to access the database with the windows authentication connection string, it works. But for security reasons, I don't want to give everyone that uses my app access to the database, thats why I tried specifying a user in the connection string.</p> <p>Additional info from my web.config file:</p> <pre class="lang-xml prettyprint-override"><code>&lt;authentication mode="Windows" /&gt; &lt;identity impersonate="true" /&gt; &lt;trust level="Full"/&gt; &lt;authorization&gt; &lt;deny users="?" /&gt; &lt;allow users="*" /&gt; &lt;/authorization&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload