.NET MVC Application - Azure Active Directory - Redirecting to LocalHost - asp.net

I have a .NET MVC applicatoin and I am trying to use Azure AD Authentication.
I create a new project and chose
"Work or School Accounts"
Cloud - Single Organiszation
At no time does it ask me for a redirect URL
I then click okay and it creates the solution (as well as registering it at Azure AD).
Problem is that when I login it alway redirects to a localhost address.
Even if I change the web.config to the correct URL of the app (as registed in IIS) it keeps redirecting. When I log into Azure AD the app is listed as an Enterprise Application and I am unable to change the homepage URL

Instead of "Enterprise Applications", you need to go to "App Registrations" in your Azure AD.
So navigate to Azure Protal > Azure AD > App Registrations > Find app registration for your application (you may need to change from "My apps" to "All apps"
Then make whatever changes you need:
You can change the home page under Settings > properties
Also, an important part is to add the required URL in Reply URLs as shown in screenshot below. Settings > Reply URLs

Related

SSO With Wordpress, Identity Server 4 and ASP .Net Core

I currently have a need to build a single sign on solution between an externally developed WordPress site which is hosted by myself and
and my own developed web application (built using ASP .Net core. I also have my own developed Security Service based on Identity Server 4.
My requirements are as follows:
User will hit the home page of the wordpress site and be presented with a Login button.
When this button is pressed they will be passed over to my Security Service for authentication with a Username and Password
If these details are validated by the security service they will be then redirected back to the WordPress site where the homepage will now
present a new button to edit their details.
When the user presses the "edit my details" button on the WordPress site they will now be redirected to my own developed web
application which will then retrieve them and display (with no additional user authentication required)
I am mainly wondering if there are any tutorials/examples out there that explain how to set this type of flow up with Identity Server 4
as from looking up to now I am unable to locate any.
Any help in this would be most appreciated.
Stuart

Basic Azure Integrated AD Authentication

There are a million tutorials on this, but I can't seem to get it to work.
I have VS 2015 with an OWIN middleware ASP .NET website running in IISExpress. Disabled Windows auth and enabled anonymous. Right clicked "Configure Azure AD Authentication" on the web project. Went through the wizard, entered domain name and app url. It navigated to a login page and seemed to install fine.
I now have a call to UseWindowsAzureActiveDirectoryBearerAuthentication in my startup. However, in IE, which should be using integrated authentication (it does for my Office365 account on the same domain), calling my WebAPI urls via GET yields 401 errors. Additionally, if I add some middleware and put a breakpoint, I see that the Thread.CurrentPrincipal is Anonymous. Is there something I need to do in my html/javscript client app to bootstrap the authentication? If so, what?

Web Publish password not the same as my Azure admin password?

For whatever reason when I published my server for the first time to Azure some really long password was generated for me that for whatever reason I didn't think would be an issue.
Apparently I need this to publish to my server.
http://i.imgur.com/w5K1ySZ.png
It does not match my Azure server admin password which I can easily change from the management portal. Is there a way to see what this password is and/or change it?
Is there a way to see what this password is and/or change it?
Click the link in Azure portal -> Your Website -> Dashboard -> Quick glance -> Download the publish profile.
Download the file and your publishing password should be there in plain text in form userPWD="7vasdfa....".
If you want to reset that you can click the link Azure portal -> Your Website -> Dashboard -> Quick glance -> Reset your publish profile credentials.
For the same solution as Kaspars Ozols presented but for the new Azure Portal you can go to App Services, open the App Service in question and click the "Get publishing profile"
Updating thread since it is now 9/2018.
Goto Azure Portal -> Dashboard -> App Service (that you are deploying to) -> Get publish profile (in the top middle of browser)
Once you have the file downloaded, look for the userPWD arg.
No it is not the same. Reason is pretty clear - security concern!
My "Azure Admin Password" is to manage all my Azure Resources. While when I publish a web site to Azure I would expect to have some other credentials, that do not have to all my azure services.
What you see there is a Deployment Credential. This is best explained in the Wiki Page for the Kudu Project. Note that Azure Web Sites run Kudu.

Update Active Directory for domain admins

I've built an application (asp.net 2010) to allow our employees to update some of their information in Active Directory. Data like website, degree, campus, building, phone extension, etc.
Everything works fine until a user who is a domain admin attempts to use the app. Since the "service account" my .Net application is using is not a domain admin, the update fails for them.
Is there a way I can make this happen without having to make my "service account" a domain admin?
You could give your service account permission to the Domain Adminis object in AD (Read Write).

Configure IIS 6 web application on a personal server

A group of us wrote a .NET web application for our University class and in order to let our prof test with it I am setting it up on my webserver at home. Here is what I have done so far:
I created a new account on my domain, I then granted that account Read, write access to the folder where the app is stored. I have setup an application pool that uses this new account as its identity and created a new site that uses the new application pool.
I initially was receiving the Service unavailable error message, so I realized I had to add my account to the IIS_WPG account. So now I am stuck at the "page cannot be found". The website is pointing to the correct folder (I can see the aspx page list from within the IIS browser) but when browsing the site either in IIS, on a browser on the server or on a browser within my network I keep getting Page cannot be found. The home directory is pointing to default.aspx which is what our app uses.
The app of course works just fine when running from within the IDE, but now that I am trying to get it to work it doesn't want to.
Any thoughts?
Thanks.
you should give error details first.
for now, I suggest you check the 'network service' account's permission.this is the ASP.NET's account.
then publish your site to *.aspx file and *.dll file. to see if there is any errors.
So I found the issue. What I didn't know is that by default, IIS 6 does not turn on support of active server pages and .NET pages in Web Service Extensions. Once I had turned this on the site began to work just fine.

Resources