How to make windows authentication to authenticate based on the user instead of the machine? - sql

I'm trying to make my web application to authenticate using windows authentication, but when i add Integrated Security = True in my connection string instead of authenticating using the user name it instead uses the machine name.
I dont know if i making myself clear but here are some images of the actual problem.
So here is the image of my connection string code on webconfig
but using this the aplication tries to authenticate using my machine name as shown here: (CEBI\INFODSKT003$)is my machine name , but i wanted it to use the name of the user logged. can someone help me here? thanks,

If you want to use the same network user for your site, regardless of the user using your website, you need to set your website's application pool to run as a network user.
You can do this by opening the IIS manager, selecting the app pool and clicking Advance Settings... under the Actions pane menu. Select Identity and then click the button beside the current user listed. Select Custom account and click Set. Use the format domain\username for the username and enter the password for the user.
If you want each of your websites user to access the database, each with its own network user name, then take a look at ASP.NET Impersonation.

Related

What should i use as a server?

I am making an andriod app with a login screen that will store simple user info.
As a test i have used a tcp server VB.net on my home computer and am able to connect and login.
client connects
server checks client name
gets the password and if it is correct returns a session that is valid till the session is ended.
Is there a better method?
thanks
Check out Firebase for user authentication. The main advantage is that it is easy to setup and clean. It allows users to login via username/passoword, Google, Facebook, Github... etc. Check the below link to find out more.
https://firebase.google.com/docs/auth/android/firebaseui

Handling Cumulocity Password Resets with a Custom UI

We have created a Cumulocity solution and created a very clean, simple interface for our users. We also offer a 'Change Password' feature to the solution users.
Changing the password in Cumulocity causes an email to be sent to the user containing a link for the user to follow and enter a new password. The issue is that the link always navigates the user to the built-in Cumulocity UI - this breaks the consistency of the user experience!
Is there a way we can create this password reset capability but have the email link direct the users to a customised UI to enter their new password?
The following should work:
The content of the password reset email can be configured on system level. Mention just the host there, not a particular app ({host}?token={token}).
Set your custom app to be the default app for the tenant. That will make sure that the user gets to your app when they click on the link.
Note: If you change the default app for a tenant, you may need to clean your browser cache to actually see the new default app.

How to achieve "Remember Me" functionality for both local and remote login pages?

I have a requirement in my application for iOS and Android, developed using IBM Worklight, to remember the user ID if the user selected this option.
I can achieve this by using localStorage, but the issue is that I have two login pages:
One is placed within the application, and the
Second is hosted on a remote server
Depending on the conditions the application will meet, either the remote login page will be displayed or the local login page will be displayed.
If I use localStorage on local page it is not accessible for server side login page. So I want to use some storage/file on the mobile to store my user id which is accessible for both local and server login page. Is this is possible using worklight/phonegap storage?
More explanation:
Remote login page is hosted on some www.xxx.com domain. My requirement is on launch of application the local login page is shown to the user, there user can enter user id and password and selects remember me option and submits form. Then user logs in and navigated to some xxx.com/yyy server page. From there when user clicks on log out it navigates to remote login page which is hosted on www.xxx.com server. As user already checked remember me option in local page the remote login page has to pre populate the user id text box. And same scenario should happen when user enters credentials in remote login page and selects remember me check box. So when user kills the application from background and relaunches the application user will get local login page where I need to pre populate the user id last time he entered.
Short answer: in my opinion, no.
Longer answer: I will explain what I think using your scenario:
Remote login page is hosted on some www.xxx.com domain. My requirement
is on launch of application the local login page is shown to the user,
there user can enter user id and password and selects remember me
option and submits form.
So far so good. You can store it in either Web Storage or JSONStore or use Cordova File API. Catch: all of these are available ONLY for the specific application.
Then user logs in and navigated to some xxx.com/yyy server page. From
there when user clicks on log out it navigates to remote login page
which is hosted on www.xxx.com server. As user already checked
remember me option in local page the remote login page has to pre
populate the user id text box.
Still plausible. Lets say the user selected 'Remember Me', so you can adjust the URL pointing to the remote login page and send with it as parameters the username and password. Assuming that there will a mechanism to handle those on the remote page.
This does not come for free, though.
This is not meant to work out-of-the-box. It's worth noting that whether Web Storage (localStorage...) is used or any other type of storage- the application and the Cordova InAppBrowser do not share the same localStorage, and the same is true if you open a new WebView.
And same scenario should happen when user enters credentials in remote
login page and selects remember me check box. So when user kills the
application from background and relaunches the application user will
get local login page where I need to pre populate the user id last
time he entered.
This is also a problem IMO, because any application is sandboxed - be it the browser app or the Worklight app, each of them is sandboxed. so you can't just go to website X, and create some localStorage for it and expect that data to be available for another WebView belonging to another app. That's the whole point of sandboxing, in order to protect the app.
And in this case, where the remote "page" will save the data, only Web Storage is available anyway, as JSONStore requires the Worklight API, which is not available when you load external websites.
Notes:
Since you want to save both username and password, you'd probably want to encrypt them in some way, so JSONStore and WL.EncryptedCache are your options, rather than plain Web Storage.

Azure Active Directory - Authentication without browser window

Is it possible to achieve Azure Active Directory authentication without going to browser window? I will have username and password via the mobile app login interface.
I need to achieve below scenario:
Use open mobile application (ios/android)
Enter Azure AD username and password to app login screen - e.g. user#tenant.onmicrosoft.com & password
I pass those information to .net web service - which need to call some Azure AD api to validate user credential before proceed to perform other business logic/make database calls
Any recommendation? I DON'T want user to redirect to any login window/page as this will not be good user experience.
I have already checked few different articles but not satisfactory response yet.
Thank you for your time.
I believe below link is helpful.
http://www.cloudidentity.com/blog/2014/07/08/using-adal-net-to-authenticate-users-via-usernamepassword/

How to log out the LiveID while using ACS on Windows Phone?

I am using the Access Control on the windows phone app. For some reasons I have to ask the user to log in with another account after logging in. However, usually the user will tick the box "Sign in automatically" and he will not be able to sign in using another account. Thus, I am wondering how to log out the liveID and ask the user to log in with another account again.
I did try using this:
this.SignInControl.SimpleWebTokenStore.SimpleWebToken = null;
this.SignInControl.GetSimpleWebToken();
But not working. Any clues on what I should do? Thanks!