Domain extension required localhost (127.0.0.1) - azure

I am trying to verify domain ( http://localhost/ ) for Single sign on Azure Portal for skype for business online.
I am getting below error :
Kindly help me to identify what I am doing wrong. If nothing is wrong then, what's the domain extension for localhost (.com for google.com, .net and etc).
Edit :
I am trying to provide App URL ID for a application registered in Azure AD. To do this, first of all, I have to verify domain by adding it for single sign on. During adding I am getting error message as above.

You can't add the localhost domain to Azure AD. It has to be an actual domain name purchased from a domain registrar.
One reason is that localhost has a different meaning for every person, it means their computer.
What are you trying to achieve?
EDIT: Your app ID URI identifies your app. It does not need to be a URL that points to your app but has to be a verified domain. For the App ID URI you can put a value such as https://mycompany.onmicrosoft.com/MyAppName. This is a typical scheme I use. Just replace "mycompany" with your Azure AD directory name. mycompany.onmicrosoft.com is a default domain you get with the directory, so you can use that. Also replace "MyAppName" with your app's name.
The App ID URI just needs to be in a domain that is in the AAD, which that one is by default. It does not need to be the URL for your app, it is just an identifier.

Related

Azure Web App created at localhost but not working

I created web app in my Azure account. I have all details like tenat id, client id, client secret etc. While creating I have added uri as https://localhost and I also added scope Data.Read and added Application ID URI. But I can't open above mentioned url. Most possible that I am missing something in my mind and dont fully understand the rule how it should work, that is why I am asking for help. I need this localhost in order to test auth with Azure tokens. What exactly I am doing wrong?
Azure allows http protocol value for only localhost. Remaining all redirect URIs must begin with the scheme https. To use https, you should install SSL certificate.
HTTP: The HTTP scheme (http://) is supported only for localhost URIs and should be used only during active local application development and testing.
I am not sure what error you are getting Azure active directory basically Redirect back to the Redirect URL specified in the request provided to AAD after login using either the /authorize or /token endpoint is what AAD does. If the match is successful, AAD publishes the success response back to the same Redirect URI after successfully authenticating the user. Once the request reaches AAD, it verifies the Redirect URI and compares it with the reply URLs listed in the app registration.
For more information in detail, please refer below links:
How to create Azure Web App | Ciemasen
Localhost exceptions
Redirect URL with http but NOT localhost

"AADSTS500113: No reply address is registered for the application". when used with Azure API Management, OAuth 2.0 authorization with Azure AD

I followed the steps from the link below:
https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-protect-backend-with-aad
But I get an error below even when the Redirect URIs of the client app has been provided:
Request Id: a58c1fe8-7d64-42b5-8603-5d2e66b45a02
Correlation Id: 65faea2b-9a2b-435c-a527-c689113417e8
Timestamp: 2021-08-16T16:24:58Z
Message: AADSTS500113: No reply address is registered for the application.
Please note that v1 of endpoints are used instead of v2 from the same link below:
https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-protect-backend-with-aad#enable-oauth-20-user-authorization-in-the-developer-console
Anyone who is able to set up based on the steps on the doc?
I checked your correlation ID and saw that there is no reply URL set for the ApplicationID listed. I don't want to list your Application ID publicly but I would search for that and confirm that you are accessing the same app where you have set the reply URL. It looks like the one you are looking at in the portal might be a different application.
Once you add the correct RedirectURL/ReplyURL to the corresponding App Registration of that app it should work fine.
I had this issue and confirmed with my IT department many times that the redirectURI was configured correctly in Azure App Services
Turns out we needed to add login.microsoft.com to the allowed CORS list
After allowing that site the application worked as expected

Getting Azure AD SSO to work with two differents URLs

We have an application that is reachable through a specific URL when connected from our office public IP, and that is reachable through another specific URL when outside the office with a VPN.
We managed to set up the oAuth2 SSO for the first usecase and I was wondering if there was any way to add the second URL, so that our users working through the VPN could also log in with the SSO.
Couldn't find a way to do it so far, if you have any clue.
Thanks !
As juunas said, when you set Redirect URIs in Azure App registration, you could add multiple redirect urls.
And when you use OAuth2 SSO, here such as using OpenID Connect flow, you could specify different redirect_uri when you authenticate the user.
Thanks for your answer, the second redirect URI configured in the Azure App was redirecting us to the first one specified, after hitting the SSO connection button. I guess we found something in the app that was forcing this redirection, we'll try to remove this setting on Monday.
Thanks for you help,
Steven

B2C changes my custom subdomain to an onmicrosoft.com subdomain; redirect_uri_mismatch; AADB2C90006

My webapp uses B2C for authentication. Everything works fine when I register my application with a default domain (tenant.onmicrosoft.com) or a simple custom domain (sampledomain.com).
I want to use a subdomain for authentication (login.sampledomain.com) and a separate subdomain for each of my partner orgs (partner1.sampledomain.com, partner2.sampledomain.com) and I've followed the instructions at
https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-app-registration#limitations with no success.
When I perform the authentication challenge
var redirectUrl = "https://login.sampledomain.com/auth-callback";
HttpContext.GetOwinContext().Authentication.Challenge(
new AuthenticationProperties { RedirectUri = redirectUrl })
The error message shows the wrong value for my subdomain:
"AADB2C90006: The redirect URI
https://login.sampledomain.onmicrosoft.com/ provided in the request is
not registered for the client"
So the subdomain I've configured 'login.sampledomain.com' appears to B2C with the incorrect value 'login.sampledomain.onmicrosoft.com'.
Is there some other properties or configuration settings I can provide so B2C doesn't manipulate my subdomain.
Has anyone else got custom subdomain working with B2C, is it possible?
Customer owned domains for Authentication / Tokens is not currently supported! All authentication/authorization requests should go to https://login.microsoftonline.com//oauth2/[authorize|token]. The fact that you will register your own domain with Azure AD will not change that fact.
There is already an idea with enough votes and in planing to support that requirements: https://feedback.azure.com/forums/169401-azure-active-directory/suggestions/15334317-customer-owned-domains
In addition, you can configure multiple reply-urls, with the note - all reply URLs shall belong to the same root domain: https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-app-registration#limitations
As suggested in the comments, I tried updating the CallbackPath (original value was '/') but it didn't make a difference, the same error occurred.
I also created a new application registration following the instructions carefully, and likewise the same error occurred.
Given those changes had no effect, it appears B2C is deriving the wrong redirect URL from my AAD tenant name not from the redirect URL settings in the request or in the application registration.
So instead of building the metadata address for the OAuth exchange using my AAD tenant name, I tried the tenant ID (GUID).
That is, instead of using the tenant name in the URL
https://login.microsoftonline.com/tfp/sampledomain.com/
B2C_1_MySignInPolicy/v2.0/.well-known/openid-configuration
I used the tenant ID in the URL
https://login.microsoftonline.com/tfp/1234abcd-1111-abcd-2222-abcd1234abdc/
B2C_1_MySignInPolicy/v2.0/.well-known/openid-configuration
The redirectUri in the request is https://login.sampledomain.com/
And just like that... IT WORKED. No more redirect_uri_mismatch, AADB2C90006 error.
I still have to test across different custom subdomains and policy types, but I can now sign into the application.
There is still a nasty bit of trial and error here, so if anyone can share information on what is happening I'd love to have a clearer picture.

IIS 8- Cannot login to website in IIS using Windows authentication when accessing by ip

Dears,
Kindly note that I have a website deployed on IIS 8 in windows server 2012.
When trying to access the website using the host name, the login popup appears and when entering the windows credential, I can enter to the website successfully,
When trying to access the website using the IP address, the login popup appears and when entering the windows credential I cannot log in, and the pop appears again, trying more it returns the same behavior when canceling the popup it gives me the below error:
HTTP Error 401.1 - Unauthorized,
Please note that the "Anonymous Authentication" is enabled using the IUSR identity, and the Windows Authentication enabled with the NTLM and Negotiate providers and the NTLM is first.
I am trying to fix this issue by edit the registry value BackConnectionHostNames and DisableLoopbackCheck following steps in the below article from Microsoft
https://support.microsoft.com/en-us/help/896861/you-receive-error-401-1-when-you-browse-a-web-site-that-uses-integrate
and still not working
Thank you in advance
Consider the differences between navigating by hostname and navigating by IP to your server. Use command prompt and do a tracert IP vs tracert hostname. The difference is by hostname, it resolves your request through the domain name services (knows who you are and who the server is on the domain). By IP, it skips the domain name services and goes directly to the target computer. The network doesn't need the DNS if you use the actual IP address, as the DNS is used for resolving names into IP addresses.
I believe you can directly put the domain name in your code so it knows where to look without relying on the DNS to automatically authenticate (although I haven't done this). Otherwise, let the domain name services resolve the user automatically by authenticating the requestee (the user) to the host (by name) when using the hostname.
Let me know if that makes sense.

Resources