w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to connect to MS SQL Server database from ASP using windows authentication specifying a windows user
You've got at least 2 3 options here: Create an App Pool on your web server which runs as domain/usr and then assign your app to this app pool, and use integrated security. Your connection string will be Data Source=dbServer01;Initial Catalog=POS123;Integrated Security=SSPI; - i.e. drop the username and password - these are inherent in the AppPool's identity. or (assuming Mixed Mode security is enabled) ask your DBA's to create a new SQL User (just called usr) with the same permissions as domain/usr and then change your connection string to standard security, with User Id=usr If you enable impersonation (here and here), you can use the domain credential without changing the app pool identity. Note the point about securing cleartext passwords, and IME this typically also requires addition

Categories : Asp Net

Test transition from Windows Authentication to SQL Server authentication
Your question is too general but here are some steps you should take. Create new sql login and only give necessary permissions to this user Update all connection strings in your application. If these are not consolidated in one config file now is the good time to do this. You can even consider creating a separate class that will handle this. Add login form to your app that will be shown at the application startup so that user can enter credentials Best way to test this is to simply disable your windows user in SQL Server and see if application is still running.

Categories : C#

change from windows authentication to sql server authentication
The following connectionString format should do the job. connectionString="user id=yourUsername; password=yourPassword;data source=yourServerName;initial catalog=yourDatabaseName;"

Categories : Sql Server

Can I use SQL Authentication to log into SQL Server 2008 that was set up with Windows authentication?
You need to alter the registry key HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL ServerMSSQL10.MSSQLSERVERMSSQLServer where MSSQL10.MSSQLSERVER is the name of your current instance. It should say "1" now, for Windows. Change it to "2", for Mixed. I believe the initial SA password at this point will be blank. However, it is possible that the SA password was set to something already, so you may not be able to login using SA even after altering the registry. You can read more at: http://www.mssqltips.com/sqlservertip/1441/correct-the-sql-server-authentication-mode-in-the-windows-registry/ Good luck.

Categories : Windows

Deploying MVC 3 website on Windows Server 2003 with Windows Authentication
What is the version of IIS you are using ? Could you try to force NTLM authentication and see whether it will change anything ? Followin technet article will tell you how to change to NTML http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/7258232a-5e16-4a83-b76e-11e07c3f2615.mspx?mfr=true. Please backup the server/iis configs before attempting any modifications to the metabase

Categories : Asp Net Mvc

WebDAV Server Error 401.2, connection issue with Windows Authentication after pausing virtual server/domain controller
We figured out what was causing our issue although I may not be able to explain entirely why it mattered. In IIS there is a setting in the "HTTP Response Headers" under "Set Common Headers" called "Enable HTTP keep-alive". We check marked this option as true and our Windows Authentication started working again. It seemed to have something to do with the connection not staying open between requests and the application or IIS not realizing the connection was restarted during the SYNC operation.

Categories : Iis

ASP.NET MVC Windows Authentication sign in as different user
I've needed to do this in classic ASP.net with web forms. I'd imagine the same would work in MVC. I had to create a Active Directory library to log in as an 'Interactive' user with the web site set to identity impersonate. You'll need to access Win32 lib calls to do so. If you're still interested I can build a sample in Codeplex or something.

Categories : Asp Net Mvc

'Login as another user' MVC 4 Windows Authentication
People reverse engineereddecompiled some code from Sharepoint that happens to have this feature. I tested it in an ASP.NET MVC 5 app and it's working as expected. The code is based on decompiling the Microsoft.TeamFoundation.WebAccess which has the "Sign in as a different User" function. public ActionResult LogOut() { HttpCookie cookie = Request.Cookies["TSWA-Last-User"]; if(User.Identity.IsAuthenticated == false || cookie == null || StringComparer.OrdinalIgnoreCase.Equals(User.Identity.Name, cookie.Value)) { string name = string.Empty; if(Request.IsAuthenticated) { name = User.Identity.Name; } cookie = new HttpCookie("TSWA-Last-User", name); Response.Cookies.Set(cookie); Response.AppendHeader("C

Categories : Asp Net Mvc

Domain User Authentication in Windows Store Apps?
I was looking for this answer too. I discovered that you have to go to the package.appxmanifest and check off Enterprise Authentication and then you can use CredentialCache.DefaultNetworkCredentials in your app to get the username, but not the password.

Categories : Authentication

How do I query and store user data after windows authentication asp.net
Store it in in the Session so it's available across requests. Although some who are more religious will say your application should be stateless and you should pull from that database on each request.

Categories : C#

Returning current user on a website with Windows Authentication in IIS 7.5
Make sure that you set Windows Authentication to Enabled in your Visual Studio project's properties. In the project file (.csproj), this translates to: <IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication> Also, set the Managed Pipeline Mode project property to Classic: <IISExpressUseClassicPipelineMode>true</IISExpressUseClassicPipelineMode>

Categories : C#

Connecting to SQL Server using windows authentication
A connection string for SQL Server should look more like: "Server= localhost; Database= employeedetails; Integrated Security=True;" If you have a named instance of SQL Server, you'll need to add that as well, e.g., "Server=localhostsqlexpress"

Categories : C#

Connect to SQL Server with windows authentication
If the company is inside a domain, and the user running the iis has permisions on the SQL Server, all you have to do is use windows authentication and that's it. Check out: http://msdn.microsoft.com/en-us/library/2xzyzb0f(v=vs.100).aspx

Categories : C#

How to use Basic Authentication to access Asp.Net MVC 4 Intranet Web API method which uses Windows Authentication from a Windows Service?
I had a similar scenario and I decided to create a new user type in our application called Service User. We created a service account in the domain and when we installed the windows service on the server (which was in the same network) we forced the windows service to run as the service account (with network domainusername and password). We have actually created 3 service accounts in our application, one for each environment: ServiceAccountDev, ServiceAccountUAT and ServiceAccountPROD and disabled/enabled each account as appropriate.

Categories : C#

How to authenticate user with form authentication in Windows Desktop Application
A Windows desktop application is nothing like an ASP.NET web application. You cannot call the different forms separately. (well you can hack the application, but if you do that, you can just as well remove any password protection) Hence forms authentication does not make any sense. You can create a login window as startup window, and check username and password against the database. And that's about it. It's a Windows application, you don't need membership provider, forms cookie ticket, etc. because unlike HTTP, Windows desktop applications are not stateless. PS: If you do a WinForms application, make the login via ActiveDirectory authentication.

Categories : C#

ServiceStack Caching/Authentication with Windows Server
Windows Caching Redis and Memcached are both available for Windows but from a quite test the Redis binaries seem easier to use. You can download them from http://ruilopes.com/redis-setup/ To configure ServiceStack to use redis have a look on the ServiceStack wiki page MemoryCacheClient I'm making the assumption you are running ServiceStack on IIS MemoryCacheClient uses a ConcurrentDictionary to store cache entries. This means it is stored in the AppPool memory which is cleared everytime the AppPool recycles. By default AppPool recycles everytime the Web.config or bin folder changes and every 1740 minutes.

Categories : Authentication

Set up Kerberos Authentication with Delegation on IIS 7 w/ Windows Server 2008
Try this: Move Negotiate to the top of the Providers' list. And, in the applicationHost.config file usually under C:WindowsSystem32inetsrvconfig, add useKernelMode="true" useAppPoolCredentials="true" to the <windowsAuthentication> tag under the <location> tag for your application, like below: <location path="YOUR_APPLICATION_PATH"> <system.webServer> <security> <authentication> <anonymousAuthentication enabled="false" /> <windowsAuthentication enabled="true" useKernelMode="true" useAppPoolCredentials="true"> <providers> <clear /> <add value="Negotiate" /> <add value="NTLM" /

Categories : Authentication

authorization username and password from sql server in windows authentication
Window Authentication Functionality to a C# Desktop Application http://code.msdn.microsoft.com/Add-Window-Authentication-833ba913

Categories : C#

Connect to SQL Server with Management Studio using Windows Authentication
The only elegant ways to connect to a SQL Server in another domain but still use Windows Authentication are: What you're already doing: runas /netonly Connecting via remote desktop and opening SSMS locally on the remote server

Categories : Sql Server

Android: client-server, user authentication
I'll authenticate using php. First of all, HttpPost httppost = new HttpPost("http://10.0.2.2/login.php"); 10.0.2.2 reffers localhost from emulator. For real device, you need real server. You have to create DB & table at localhost using phpmyadmin.(Assuming you are using WAMP/LAMP) Now, my php file is like this: <?php $link=mysql_connect('localhost','root','password');// give your username & password if (!$link) { die('Could not connect to MySQL: ' . mysql_error()); } mysql_select_db("database_name"); $sql=mysql_query("SELECT * FROM Login_Table_name where user_name = '".$_REQUEST['username']."' and password = '".$_REQUEST['password']."'"); if (mysql_num_rows($sql) > 0) { echo "success"; }else{ echo "login failed"; } mysql_close($link); ?> (Assuming

Categories : Android

MVC application authentication set to Windows. Httpcontext.current.user.identity.name empty string
OK! Here is the answer. After sifting through the HttpContext object, I found the windows ID of the current user nested in the LogonUserIdentity child object. HttpContext.Current.Request.LogonUserIdentity.Name Why the normal HttpContext.User object is not being set? I have no idea! Anyway, problem solved!

Categories : C#

Connecting to SQL Server via Windows Authentication with Java providing credentials
I'm pretty sure this is unsupported. When a user connects through a Windows user account, SQL Server validates the account name and password using the Windows principal token in the operating system. This means that the user identity is confirmed by Windows. SQL Server does not ask for the password, and does not perform the identity validation. Windows Authentication is the default authentication mode, and is much more secure than SQL Server Authentication. Windows Authentication uses Kerberos security protocol, provides password policy enforcement with regard to complexity validation for strong passwords, provides support for account lockout, and supports password expiration. A connection made using Windows Authentication is sometimes called a trusted connection,

Categories : Java

Connect my Sql Server 2008 database to my Java Project with Windows Authentication
With the error you are getting "com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication", suggest that the issue is with the JDBC driver not with the database or the application code.. What version are you using, as per Microsoft forums, the issue is fixed with the version 1.2, can you get the latest version installed and try again. The latest version can be found at http://www.microsoft.com/en-in/download/details.aspx?id=11774 Reference: http://www.microsoft.com/en-in/download/details.aspx?id=11774

Categories : Java

Forms Authentication User.IsInRole(), Authorize attribute - not working on production server
ok I solved it myself, This post got me on the right track. One problem was, that I couldn't change the directory permissions for the Application Pool User in the Default Web Site So I created a New Website in IIS 7.5 and deployed my Application again. Then I checked the permission for the application pool User to the directory. D:webapplication -> right click -> Properties -> Security -> allow modify for the Application Pool User. Last I got some error for some .dll's missing (really don't know why). So I upgraded my ASP.NET MVC 3 Application to MVC 4 and everything works now (local and remote).

Categories : Asp Net Mvc

Can the smart card authentication process treated as a user digitally signed the content(and then get verified on the server)?
I was able to get some answer elsewhere. In case anyone is interested http://security.stackexchange.com/questions/41777/can-the-client-certificate-authentication-process-treated-as-a-user-digitally-si

Categories : Dotnet

In ASP.NET is there an event fired on a Windows Authentication log in failure? (Logging the details of a Windows Authentication failure)
I was looking at the same issue, and looks like there is no events for windows authentication, even that Authenticate event is common for forms and windows. But I found a solution to this! http://www.codeproject.com/Articles/11202/Redirecting-to-custom-401-page-when-quot-Access-de UPDATE From original article protected void Application_EndRequest(Object sender, EventArgs e) { HttpContext context = HttpContext.Current; if (context.Response.Status.Substring(0,3).Equals("401")) { if(User.Identity.IsAuthenticated) { // this means user is authenticated, but 401 still returned // which means no access to page or whatever you are trying to access? } } } UPDATE2 I also found out that this solution doesn't work in all cases. I was testing in different envir

Categories : Asp Net Mvc

Configure IIS Windows Authentication to return HTTP 403 instead of HTTP 401 for permission denied with an authenticated user
What did not work I tried just about every IIS configuration permutation with no luck. I goofed around with the Windows authentication provider settings, like NTLM, Negotiate, and Negotiate:Kerberos. None of them seemed to do the trick. This isn't too much of a surprise since the browsers are deciding to try authentication again, even though they probably shouldn't. 401 Unauthorized The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refu

Categories : Asp Net

MVC4 Forms Authentication but Windows Authentication in Admin Area
Supporting both forms of authentication for one site is a little dicey. I would suggest setting up two separate sites, one for admin and one for the members that both point to the same database. Check out this discussion about the topic: Mixing Forms authentication with Windows authentication

Categories : Asp Net Mvc

Trouble Connecting to sql server Login failed. "The login is from an untrusted domain and cannot be used with Windows authentication"
Why not use a SQL Server account and pass both the user name and password? Here is the reason why. In short, it looks like you have an authentication issue. The problem with workgroups is there is no common Access Control List like Active Directory (AD). If you are using ODBC or JDBC, the wrong credentials are passed. Even if you create a local windows account (LWA) on the machine (SE) that has SQL Express installed (SELWA), the credentials that will be passed from your client machine (CM) will be CMLWA.

Categories : Sql Server

Setting a post-authentication View for Windows Authentication
Create a custom AuthorizeAttribute like this: public class MyAuthorizeAttribute : AuthorizeAttribute { private UnitOfWork _unitOfWork = new UnitOfWork(); protected override bool AuthorizeCore(HttpContextBase httpContext) { var isAuthorized = false; var username = httpContext.User.Identity.Name; // Some code to find the user in the database... var user = _unitOfWork.UserRepository.Find(username); if(user != null) { // Check if there are Details for the user in the database if(user.HasDetails) { isAuthorized = true; } } return isAuthorized; } public override void OnAuthorization(AuthorizationContext filterContext) { if (filt

Categories : C#

Ember user authentication (Client side and Server Side completely separated)
Ember-auth isn't necessarily just for apps. You can configure the endpoints like signInEndPoint and signOutEndPoint to point to the urls that need to be hit on your server to do authentication. Also there isn't any reason to bundle the client-side and server-side in the same repository here. The demo does this because the asset pipeline support in rails is very convenient for demoing, typically for avoiding a front-end build step. You can treat it as just a library file that you include alongside ember.

Categories : Ember Js

Should HTTP Basic Authentication be used for client or user API authentication?
By authenticate the client you probably mean the usage of API Key, this mechanism is used to track the concrete application/client. The second thing is that it gives you the possibility to disable the application by disabling the key, for example when client's author removes his account from the service. If you want to make your API public then it is a good idea. But you need to remember that it gives you no real protection, everybody can download the client and extract that key.

Categories : Api

Get Windows User Account Name using Java from Server Side
Either request.getRemoteUser() (returns String of username) or request.getUserPrincipal() (returns Principal object that contains username) should provide you with the username.

Categories : Java

Hybrid of Windows Authentication and Forms Authentication in ASP.NET MVC 4
You need to use Action Filters for this purpose. You can extend the AuthorizeAttribute like this: public class MyAuthorizeAttribute : AuthorizeAttribute { private UnitOfWork _unitOfWork = new UnitOfWork(); protected override bool AuthorizeCore(HttpContextBase httpContext) { var isAuthorized = false; var username = httpContext.User.Identity.Name; // Some code to find the user in the database... var user = _unitOfWork.UserRepository.Find(username); if(user != null) { isAuthorized = true; } return isAuthorized; } public override void OnAuthorization(AuthorizationContext filterContext) { if (filterContext == null) { throw new ArgumentNullException("fil

Categories : Asp Net Mvc

Prevent windows admin user from reading a SQL Server database
I do not believe that there is anyway to prevent an database user from viewing or otherwise altering a database installed on a SQL Server instance to which they have administrative access. However, it is possible to make it very difficult (but not impossible) to view or modify stored procedures. Microsoft uses this approach with their GP accounting software. To create stored procedures that cannot be reverse engineered easily, create them with the ENCRYPTION option. See http://msdn.microsoft.com/en-us/library/ms187926.aspx for more detailed info.

Categories : Database

Enable Remote Connections on Windows Server 2012 via AWS User Data Field
I ended up doing the following: Stop the instance, detach the root volume and attach it as another partition on another Windows instance. Once attached, go to disk management and set it online, mount the registry hive and make the proper changes. Navigate to the following location in the registry HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server In the right pane, locate a REG_DWORD value named fDenyTSConnection. Double-click on fDenyTSConnection and change the value data from 1 (Remote Desktop disabled) to 0 (Remote Desktop enabled). If the server was placed in drain mode, then locate a REG_DWORD value named TSServerDrainMode and change the value data from 1 (Remote Desktop disabled) to 0 (Remote Desktop enabled). Unmount registry, set t

Categories : Powershell

Using file_put_contents on android with php server writes a file, but a Windows user using a USB cable to the device cant see it
Maybe you can create a file with windows, check the owner of the windows file and then create a file with "file_put_contents" and check their owner. Then you can change the owner of the file to the windows user, if the web user is the root. Or try to use 0777 as chmod ;) Give it a try ...

Categories : PHP

How to create a test user in seeds.rb using user authentication (Monban)
You can use the SignUp service object https://github.com/halogenandtoast/monban/blob/master/lib/monban/controller_helpers/sign_up.rb SignUp.new({name: 'foo', email: 'foo@bar.com', password: '123'}).perform and if you want to make it look nicer just define the sign_up method yourself def sign_up(user_params) SignUp.new(user_params).perform end Hope this helps! Let me know if you have any other Monban related questions.

Categories : Ruby On Rails

Why is Azure deployment slower on Windows 2012 Server than on Windows 2008 Server
http://social.msdn.microsoft.com/Forums/windowsazure/en-us/7cf664b0-5876-4d6a-b54d-fda46c544c6f/azure-deployment-slower-with-w2012-server-than-w2008-server-or-w2008-server-r2?forum=windowsazuretroubleshooting: 'I tried with .NET 4.5 with the same results. I think is something related to Azure SDK 1.7 & 2.0 Programmatically configure Azure cache client' Answer by Jordi Torra It seems to be a problem with the Azure SDK 1.7 & 2.0.

Categories : Asp Net

User Authentication - Passing user Id around to each page - Best Practice?
1] is likely the 'correct' answer, however if you already have access to the session for the specific user, you already know who they are so the cookie is just additional 'stuff' that the server and browser will have to send. In other words, if your server already has a session to which you have access, and that session already maps to the user, you are already following the that user around. 2 and 3] require state management or doing server side processing on the page's content delivered to the client.

Categories : Ruby On Rails



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.