Single sign on from SharePoint to another asp.net web application - sharepoint

I have a scenario where I want to get the single sign on experience between SharePoint and another ASP.NET website. They are both on same domain and both using windows authentication. Both website have anonymous authentication turned off and windows authentication turned on. Can anyone please help for the following scenario?
User go to SharePoint 2010 website
Login to SharePoint by entering windows username and password to landing login page
SharePoint 2010 contains iframed webpart which go to another asp.net website on same domain (different port number)
User should be able to access the another asp.net website without login
My problem is during step 4 where user have to enter the windows credential again to login to asp.net website. How can I resolve this issue?
Thanks,
SJ

Windows authentication is not automatically passed between applications. Since you choose to iframe the other site you will need to separately login to it.
I find it a bit odd that your users dont get automatically logged in, but then you maybe dont have domain login on your computers.
However this can be automated a bit with impersonation, check this thread http://forums.asp.net/t/304484.aspx

Related

MVC Website On IIS Acquire Domain User Without Login Prompt

I have an MVC site running on IIS 10. The IIS server and our users are all on the same domain. My question: is there a way for the MVC website to determine the domain user without having the login prompt appear when accessing the website? I turned on Windows Authentication - this causes the login prompt, but it does give me the domain user. The Allow Anonymous returns the IISUSR account. I'd like to access the domain user, but not have the login prompt appear. Thanks in advance.

Windows authentication is allowing to access web site only for IIS Administrators and not for other users why?

I am facing an issue with windows authentication in IIS. I have a website which is intranet site. But the problem is that only the admins of IIS can use it, not the other users in the same intranet. Windows authentication pop up is showing but after entering the username and password it is displaying the same authentication pop up.
I actually found the answer to this, it might help someone who will be stuck like me. The problem was in the security tab we did not add user Account as "Users". We had all the accounts like IIS_USRS,admin, etc but we forgot to add "Users". After adding it allowed everyone to access the site.
The strange thing is when your application doesn't need Windows authentication then IIS_USRS are enough otherwise don't forget to add "Users" or whatever account needed to access.
This can normally happen, by permissions a bad configuration of permissions.
Try doing some of the following options.
1.Verify that the user of the "Applications Pools" where the app is running, has the necessary permissions in the location where the app is located.
2.Verify that you have "Windows Authentication" enabled in your app. (Of course this is only if your app requires Windows Authentication if your app does not require Windows Authentication only activates Anonymous Authetincation and deactivates the others.)
3.Verify your app providers are set in this order for Windows Authentication(NTLM,Negotiate)

Azure Active Directory and Federated Authentication

We're using Azure Active Directory with Federated Authentication. This is working without a problem - but we need the ability to have users sign in with credentials other than their logged in Windows credentials.
What happens right now is
User navigates to our web app and the Azure ADAL for JavaScript attempts to log in
The user is redirected to https://login.microsoftonline.com/common/oauth2/authorize?response_type=id_token&client_id=xxxx&redirect_uri=xxxx&client-request-id=xxxx&x-client-SKU=Js&x-client-Ver=1.0.2&nonce=xxxx
The user is presented with a username and password box.
Upon entering the username (even if it is someone else's username) (as soon as focus is lost from the username textbox), the page shows
It looks like this email is used with more than one account from
Microsoft. Which one do you want to use? Work or school account Work
or school account Assigned by your work or school
Upon clicking "Work or school account", the user is presented with
Redirecting We're taking you to your organization's sign-in page.
The page redirects to the url
https://ds1.mydomain.com/adfs/ls/auth/integrated/?username=me%40mydomain.com&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=estsredirect%3d2%26estsrequest%xxxxx&popupui=1
The user is automatically logged in using their active Windows credentials (even if they entered a different username on the previous page).
If I navigate to the URL https://ds1.mydomain.com/adfs/ls/auth/integrated/?username=me%40mydomain.com&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=estsredirect%3d2%26estsrequest%xxxxx&popupui=1 using a Windows session with a non-domain (local) account, I get a standard Integrated Authentication prompt
So - it seems like our ADFS server is using Integrated Windows Authentication on an IIS Website.
My question is - how can I allow the user to log in as a different domain user for the web app. Is there a special ADFS login URL I can use? And if so, how do I tell the Azure app to use that URL. Or is there a way to disable Integrated Authentication in some other way, on demand?
Thank you.
UPDATE:
I see that if I point the ADFS URL to the basic auth endpoint
https://ds1.mydomain.com/adfs/ls/auth/basic/?username=me%40mydomain.com&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=estsredirect%3d2%26estsrequest%xxxxx&popupui=1
I am prompted for basic authentication (exactly what I want)...so how do I tell my Azure AD or Azure AD App what login URL to use? And how can I control it conditionally?
You would need to either remove AD FS from the Local Intranet zone on the relevant machines so they prompt, or better, look in to the User Agent based targeting in AD FS and configure those machines to send a User Agent that triggers Forms Based AuthN.
Have a look at https://technet.microsoft.com/en-us/library/dn727110.aspx for more info on this.
Answer is actually pretty simple (with some help from Fiddler):
Add &prompt=login to the query string generated by the ADAL JavaScript when redirecting to login.microsoftonline.com. This causes the MS portal to redirect to the ADFS Forms Auth URL instead of the one using integrated security.

WSS 3.0 Authentication mode

I have two questions on wss 3.0
How to know that kind of authentication is currently in use.
How do I set the authentication in such a way that users on office network don't have to input user name\password? So if users are in the office they can just go straight in without using a password? Those outside the office will obviously still have to use the password.
Detail answer would be really great.
For #2, you also need to make sure that Internet Explorer has your site listed as a trusted site or intranet site so that IE will be willing to pass the credentials to the Sharepoint Server
There are two build-in authentication types: windows and forms.
You can configure it in central administration (as far as I remember in "Application Management" section).
Windows authentication will use current user's windows credentials to login on site. So if SharePoint is configured with windows authentication and permissions were granted to user there will be no request to enter login/password. In other case (outside of office for example) site will ask for credentials.

Sharepoint user profiles with forms authentication

I've imported a bunch of users into my Active Directory with some custom fields. Then I did a profile import from Active Directory to Sharepoint with all the custom fields and regular fields. After this, I needed each user to be in a site collection with a MySite set up for them. I did that by writing some code that ensured the user existed and then checked the profile attribute "personalspace" to see if a MySite had been created. Everything worked great until some of the users needed to login from outside the network.
I'd like to get rid of the windows authentication pop-up that a user would get if they hit from outside the network (or haven't added the site to their trusted zone in IE). I've extended my web application to create an internet zone. Then I edited the web.config of the internet site to do active directory forms authentication, along with editing the Central Administrator's web.config so that it can see the data source. This is all well and good, the user can login through a nice interface. The only problem is that now the user is detached from their user profile. Essentially Sharepoint views a windows authentication user and a forms authenticated user as two separate users.
Is there a way to link the profiles? Do I have to write a custom membership provider to log a user in and then link them up to their windows account? Is there a way to log a user in from the internet web app and then spoof their windows credentials and pass it to the intranet? Do I need to recreate all the user profiles based on the forms authentication data source?
Is this what are you looking for .. http://grounding.co.za/blogs/brett/archive/2008/01/09/setting-up-dual-authentication-on-windows-sharepoint-services-3-0-forms-and-ntlm.aspx ?
See ya
I've been trying to accomplish the same thing, with exactly the same problem - the "forms-authenticated-me" is not the same as the "windows-authenticated-me" to sharepoint, and I can't see how to map the two.
After a lot of frustrating efforts, I think I've finally realized it's not possible. In retrospect, this isn't too surprising.
here's an excerpt from http://msdn.microsoft.com/en-us/library/bb975136.aspx (my emphasis added)...
Deciding to Use Forms Authentication
Some organizations want to use Windows
users and groups in SharePoint
Products and Technologies, but enter
credentials via forms authentication.
Before using forms authentication,
determine why to use forms
authentication in the first place:
What is the business driver? If user
accounts are stored in a location
other than an Active Directory domain
controller, or if Active Directory is
not available in a particular
environment, using forms
authentication with a membership
provider is a good choice. But if you
want to force logon only via forms
authentication, but still use Windows
and all of the integrated features it
provides, you should consider an
alternative such as publishing the
SharePoint site with Microsoft
Internet Security and Acceleration
(ISA) Server 2006. ISA Server 2006
allows users to log on by using a
forms authentication Web form, but
treats them like Windows users after
authentication. This implementation
provides a more consistent and
compelling experience for end users.
You can set up the Forms Authentication to use the Active Directory Forms Authentication provider. You'll get the best of both worlds.
The login prompt will be the Forms Authentication prompt that you want, but the profile and login info will come from Active Directory.
Follow these instructions to configure the provider:
How To: Use Forms Authentication with Active Directory

Resources