Azure Application Registration: App Domain - azure

I have a request to register an application in my Azure tenant.
The request includes info on the App Domain and Redirect URL.
After registering the app, I gave the app name, app id, and client secret to the requestor.
He came back and said that he can see the redirect URL when he looked up the app ID but the App Domain field is still blank.
I do not see this field option when registering an application. Does anyone know where this is located or how it is configured?

You can add a custom domain in azure ad under the custom domains tab in the portal.
Just the click on the add custom domain can fill the subsequent form.
Refer the following documentation on custom domains.

Related

Infinite Loop between WebApp and AAD Authentication after introducing Application Gateway

We were trying to enable AppGateway on one of our WebApplication hosted on AppService which use OpenIDConnect to Auth the request against Azure AD using Code with PKCE flow.
Since our *.azurewebsite.net url is going to be private, we had to update the "Redirect URI" in AAD and in the Web.config to rout the request back to AppGateway after Authentication and then with the Authenticated Payload the request should hit the Backend Pool which has the AppService.
But, every time we try this configuration we ended up being in an Endless Loop between
AppGateway --> AppService(BackendPool) --> Authentication page --> AppGateWay -->...
• You are encountering the endless loop when setting up the application gateway in front of your app service because the reply URLs set for the app service on the application gateway may not be correctly configured due to which even after redirecting to the configured reply URLs, you are not able to go to the set app service page after authentication. For this purpose, kindly go to the ‘Authentication/Authorization’ blade on your app service, click on the “Azure Active Directory” option. In there, click on “Manage Application”. This will take you to the Azure Active Directory configuration. In that, select the ‘Express’ mode, and select the option for ‘Manage Application’, and in that select “Reply URLs” in the “Settings” blade. This will open the various reply URLs that the application is able to use to send an authenticated user back to your application.
• If you configured your custom domain before setting up Azure Active Directory authentication, both your ‘*.azurewebsites.net’ and custom domain URLs should be configured for the reply URLs. If your custom domain is not there, be sure to set up the reply URL as ‘https:///.auth/login/aad/callback’. Once the said has been set up correctly as specified, you should be able to authenticate using either the custom domain or the *.azurewebsites.net hostname to ensure you can sign in.
• Ensure that you change your custom domain from pointing to the App Service to pointing to the Application Gateway's public IP or DNS name. This change is made in your DNS registrar.
Finally, I would suggest you to please refer and go through these below documentation links for more details on configuring the app service for custom DNS/default domain and AAD authentication: -
https://learn.microsoft.com/en-us/azure/application-gateway/configure-web-app?tabs=customdomain%2Cazure-portal#configure-a-web-app-behind-an-existing-application-gateway
https://learn.microsoft.com/en-us/archive/blogs/waws/setting-up-application-gateway-with-an-app-service-that-uses-azure-active-directory-authentication#setting-up-the-application-gateway

Application ID URI Throwing Error in Azure AD App Registration using Terraform

I have a web app and corresponding app registration. Many months back in the "Expose an API" section in App Registration i was able to add the URI of my web app which was "https://app-coalsa-api.azurewebsites.net"
Right now when i try to do the same with another project with a similar kind of environment using Terraform, i get the error as attached in the screenshot.
Any idea if this error is coming because of the new Azure AD Provider and what shall ideally be in the "Expose an API" in app registration
Could it be that this app registration is configured as multi-tenanted?
It is a requirement for multi-tenant app registrations to have an App ID URI that uses one of the verified domains in the Azure AD tenant.
Because the azurewebsites.net is managed by Microsoft, it's not possible that it's a verified domain of your tenant, which could explain why the update fails.
See below:
For a multi-tenant application, it must be globally unique so Azure AD can find the application across all tenants.
Global uniqueness is enforced by requiring the App ID URI to have a host name that matches a verified domain of the Azure AD tenant.
From https://learn.microsoft.com/en-us/azure/active-directory/develop/howto-convert-app-to-be-multi-tenant#update-registration-to-be-multi-tenant.
Looks like the answer is in error message itself. You can update the values inside Expose An API and possible values would be api://{object-IF-GUID} or https://{FQDN}.
Whenever any Azure AD app registration created it generates an object-Id and also linked who has triggered application id creation inside Azure AD.
you can update the values with any native azure services or any custom domain mapped to it but cant change or mapped to altogether new application otherwise it will result failure.
I have tried it and got the below error message:
{"error":{"code":"HostNameNotOnVerifiedDomain","message":"Values of identifierUris property must use a verified domain of the organization or its subdomain: 'https://{test-rohit-app-name}.azurewebsites.net'","details":[{"code":"HostNameNotOnVerifiedDomain","target":"identifierUris","message":"Values of identifierUris property must use a verified domain of the organization or its subdomain: 'https://{test-rohit-app-name}.azurewebsites.net'"}]
In your scenarios, accepted values are either {webappname}.azurewebsites.net or custom domain mapped to this web app.

Getting Undefined Sign-On URL error while redirecting from Azure to my app

I'm integrating Azure AD login authentication to my web app. I have created an account in azure development portal and registered my app details. while registering I didn't provide value for Application ID URI. but provided other details such as redirect URLs, type: web app etc
my app URL -> https://my-sample-app/my.dashboard/
my redirect url is ->https://my-sample-app/my.dashboard/ws/aad/callback/
Note : ws that comes after my app url is the servlet adapter configured
Name of the app regist
In my application, I have written the code logic to receive the azure returning tokens through a web service end point ("/aad/callback/"). my app is a java web app so used Azure java SDK
when i hit the "http://portal.office.com" and provide the credentials registered in azure , i can see my app as an icon in the office365 landed page. once i click my app icon then i'm redirected and got an error that
Something went wrong...
You cannot access this application because it has been misconfigured. Contact your IT department and include the following information:
Undefined Sign-On URL for application "My Dashboard (Dev)"
Can someone help what went wrong here ? I can see that the app id URI is not configured during the app registration in azure. is that the reason ?
The Sign-on URL is different from the app ID URI.
App ID URI is used to ide tify APIs.
The Sign-on URL / Home page URL is put in links like the Office front page or the My Apps portal.
You can set it in the application registration's Branding tab.

How to configure Azure AD app registration redirect URLs to work for localhost and Azure deployment?

I've registered an app in Azure AD and can successfully authenticate users against it while running on localhost.
The Azure AD app's Redirect URI is set to https://localhost:44352/sigin-oidc and the Logout URI is https://localhost:44352/signout-oidc
If I deploy my MVC app to Azure the host name will be different from "localhost". Do I have to register another app for deployment or just add a second redirect URI? But what about the logout URL then - only one can be configured there?
Second redirect URI. Here are some pointer on restrictions on redirect URIs.
Logout URI is only relevant to your application. Not the application registration.
If you are referring to the post_logout_redirect_uri, as described here - it must registered in the redirect_uris as well:
Or if you consider the logoutUrl as described in the Manifest - that is only used when you perform a Single-sign-out of all web apps, as described here. Frankly, there are very few reasons to use the single sign out capability of Azure AD. And, it requires of course that all apps are configured for single sign out.

Azure App Registrations Sign-on URL

I am registering an app with Azure, so that I can automate deployments with Ansible. Ansible is not a Web App (but a simple command line tool), but on an app registration it asks to fill in a mandatory field Sign-on URL. The description it gives is The URL where user can sign in and use your app. But once again, there is no URL and no Web App.
I could not find another way to register an app and it seems that this is the recommended way from the Ansible side. Ansible docs on Azure are linking to App registration in Azure.
So for now, I have entered a random URL there, but if it is not needed, then why Microsoft are enforcing it on us?
The reason this is a required field during app registration is that during the vast majority of cases, the app in question is actually an app that people associate with a URL and can sign in to.
If you don't need the Sign-on URL, then you can put whatever value you'd like. I recommend a unique URL that is unlikely to collide with other people's apps or other apps in your organization.
You can also always do the app registration programmatically (since it look like scripting is your scenario anyway), using Azure AD PowerShell's New-AzureADApplication (followed by New-AzureADServicePrincipal).
Sign-On URL: For "Web app / API" applications, provide the base URL of your app. For example, http://localhost:31544 might be the URL for a web app running on your local machine. Users would use this URL to sign in to a web client application.
That's because you register an web app/API. The type of application register will add to the access panel and the users could login the app through access panel via the Sign-on URL you config it when you register the app.
As Gaurav Mantri suggested, if you were not developing web app you should register an native app instead of web app.
More info about Azure app register, you can refer the document below:
Integrating applications with Azure Active Directory
Register your client application with Azure AD

Resources