Azure SSO- How to remove approval required screen after sign in - azure

I want to add Azure AD auth for my custom SPA. I have registered the app in the app registration in the Azure portal.
When I call this "APP" using APIs I am able to get the login screen and MFA but after logging in to the Azure account I am getting Approval required screen and I want to get rid of this, what should I do?

To get rid of Approval required screen after signing in, user settings of your app have to be changed. Only the admin with Global Administrator role of the tenant can do that. So, make sure to have that role.
Note the client_id of your app that can be found in your Overview tab.
Create an adminconsent URL like this:
https://login.microsoftonline.com/common/adminconsent?client_id=your_client_id
Now, access this URL in the browser and it asks you to pick the azure account.
Select the account with Global Administrator role.
Now, a consent prompt will appear where you have to accept the permissions.
Go to Azure Portal -> Azure Active Directory -> Enterprise Applications -> User Settings -> Admin Consent Requests.
Set ‘Users can request admin consent to apps they are unable to consent to’ to “No”
By this, when the user tried to access the application using authorization API, they won’t get ‘Approval Required’ page anymore that disables all future admin consent operations.
For more information, go through below links.
References:
Disable approval required consent in Azure - Microsoft Q&A
Disable approval required consent in Azure - Stack Overflow

Related

Azure AD restrict users to login if not assigned to aplication without user assignement

We want to use Azure AD as the authentication mechanism for our project. To do that, in our organization Azure AD, i have registered an application for our project, added the SPA redirect URI. Added the internal users into the same enterprise application by using Add Users/Groups. Since the frontend app is based on React, we are using #azure/msal-react for authentication and using org AD tenatid and the respective clientid in authConfig.js file with scope as User.Read. Here i am using loginRedirect to start the login process on load of application.
As we are using org Azure AD, there are other applications as well created by other developers. I want to restrict login of other internal users to access this application. I was trying to use User Assignment required as Yes to achieve that, but in that case it is asking for "Need Admin Approval" which we don't want. As for big organization, Global Admin/Application Admin/Cloud Admin will be in different timezone and user shouldn't wait to get the approval from them.
So is there any way i can restrict other internal users to access the application and show them unauthorized page when trying to access the application. Only allocated users would be able to login to the application.
Please suggest. If you need anymore info, please let me know.
Thanks in advance.
To get rid of "Need Admin Approval" screen, please follow below steps:
Make sure you have "Global Admin Role" to change user settings in Azure active directory.
Go to Azure Portal -> Azure Active Directory -> Go to Enterprise Applications -> Click on User Settings -> Admin Consent Requests. Set ‘Users can request admin consent to apps they are unable to consent to’ to “No”.
Make sure to Grant admin consent for the required api permissions you added to your application.
After granting it, it should be like below:
I have tried in my environment, I was able to login to the application without waiting for Admin approval.
AFAIK, to restrict other internal users to access the application and show them unauthorized page when trying to access the application try making use of conditional access policies.
To know how to do that in detail, Make use of below references:
https://learn.microsoft.com/en-us/azure/active-directory/conditional-access/howto-conditional-access-policy-block-access#create-a-conditional-access-policy
c# - iOS authentication with Azure AD - Stack Overflow.

Need Admin Approval Azure App with Allow User Consent Enabled

I've created a web app using asp.net core and I'm trying to authenticate with Azure AD. I've created the app registration and hooked everything up. I'm able to log in fine but when anyone else tries they get the "Need admin approval" message.
My app doesn't require any API permissions and my org has Allow User Consent for Apps enabled. Any ideas on why I would still be getting this error message? I've read all the other posts I could find on this and they didn't seem to be quite the same. This is single tenant only, no api permissions needed.
Here is how I'm setting it up in the web app services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme) .AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAd"));
Edit:
Crap, didn't read them all apparently. Answer in this post was my issue as well. I had Assignment required enabled, turning it off allowed users to sign in. Is there no way to have users consent and require assignment?
We can follow the below workaround :-
We must need global administrator role to turn on the admin consent workflow
Then Navigate to Enterprise application>User Settings>Admin consent(select yes)> Save.
For complete setup please refer the below links:-
MICROSOFT DOCUMENTATION:- Enable the admin consent workflow
BLOG:- How to grant admin consent to applications in Azure

Azure AD SSO login problem with admin account

I've registered a single application in Azure AD for the following reasons.
Azure AD SSO (From Any Azure AD directory)
Read users, groups, and their members
Provided following permissions and granted admin consent.
NOTE: We still depend on some of the Azure AD Graph API. So, we have added the legacy API permissions.
I can able to contact the Azure AD using REST API and get the user, groups and other information.
When I try to sign in to the application from any other directory, I'm getting the following consent screen. I can able to provide the consent and proceed to log in.
But, when I try to login into the same directory, I'm not getting the consent screen even when I logged in with the Azure AD admin. Stuck in the following screen.
When I register separate applications for SSO and REST APIs, this issue doesn't occur.
I would like to know why I'm stuck in the above screen when combining both SSO and REST API permissions.
• Please check whether the correct Azure AD roles have been assigned to your account ID, i.e., Global Administrator, Cloud Application Administrator, Application Administrator, or owner of the app object through the as one of these is needed for you to access the application. Also, ensure that you have assigned your account ID the correct app role assignment for the admin consent to be allowed during the SSO signup process as below: -
You can check the app role assignments for your account ID through the Enterprise application blade and searching your application there, then opening it and selecting the users and groups blade, check the app role assignment that your account ID has to that application while also, giving ‘Azure Service Management’ api permissions for user_impersonification as below, thus ensuring that you account ID will be having correct API permissions.
Once, the above settings are configured correctly, you should be able to access the application through your admin credentials.

Why the user needs to request admin approval in Azure Single Sign On after he is added to users list?

I created an SSO application in the azure portal. As a global administrator I signed to my application with sso and I'm able to fetch the access token and graph details.
In our organization we need to allow few users to use this application. So I added their emails to the 'Users and Groups' in Azure portal. So When the users signed in,they allowed the consent permissions and then the below window appears. May I know the reason?
Is this normal or any kind of bug from side?
Is this window appear everytime once the user got approval ?
Please help me to solve this as I am going through a tough time.
It is not a bug and it is Admin Consent. You as a global
Administrator need to approve the concern from azure AD.
This window will appear only once and it will not appear once user log-in after consent next time.
Please go through Ms Document which has information of configuring Admin Consent.
It seems you are trying to use application permissions, since both shown permissions do not require admin consent for delegated permissions scenarios.
You can read about permission types at https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent#permission-types
If you want to review the configuration of your application you can turn to Azure AD. On page https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/CallAnAPI/appId/YOURAPPID/isMSAApp/ (replace YOURAPPID with your app id) you should see something similar to this:
If you at (1) have any of type "Application", these will require admin consent.
Regardless of whether you have any of such, you (required admin privileges) can grant application consent for the tenant using the button at (2).

Azure Active Directory Login: Web App Permissions, User Consent not triggered

I have currently set up a AAD instance and I am authenticating my users against it via my web app, and it’s working great.
When I added and configured the application on AAD, I added the required Application and Delegated Permissions to access the Office365 Calendar API. However, the only thing that is missing is that during the login flow users aren’t being prompted to grant consent for the permissions, as it should happen from what I’ve read in your docs: https://msdn.microsoft.com/en-us/library/azure/dn132599.aspx#BKMK_Consent
I’m not sure what I’m missing. Apparently, from the docs,
After the user has signed in, Azure AD will determine if the user
needs to be shown a consent page. This determination is based on
whether the user (or their organization’s administrator) has already
granted the application consent. If consent has not already been
granted, Azure AD will prompt the user for consent and will display
the required permissions it needs to function. The set of permissions
that is displayed in the consent dialog are the same as what was
selected in the Permissions to other applications control in the Azure
Management Portal.
So maybe somehow I have already probably implicitly granted admin consent for those permissions, but I don’t know how that happened.
I've attached the permissions I configured on the AAD App.
Any help would be appreciated.
If an admin creates an application in their tenant using the AUX portal (manage.windowsazure.com), and requests permissions to other applications, then users in that same tenant are pre-consented for that application. Note this behavior is NOT true for our other App Registration Portals (portal.azure.com or identity.microsoft.com)
I believe this is why you are not seeing the consent dialogue when user's in your tenant are signing into your application. If you would like to push the consent dialogue experience, there are a few different things you can do:
You can use query strings to prompt "consent" or "admin_consent" during login. Check here: https://msdn.microsoft.com/en-us/library/azure/dn645542.aspx
You can delete the service principal for your application from your tenant using AAD PowerShell. You can learn how to do that here: https://msdn.microsoft.com/en-us/library/azure/dn194113.aspx
You can have a user from another tenant try to login to your multi-tenant application.
You can create your application under a non-admin account.
I hope this helps!
Shawn Tabrizi
Try this:
What is the Resource parameter in Windows Azure AD tenant application oAuth 2.0 specification
Changing the resource parameter to https://graph.windows.net did the trick for me.
Furthermore, Microsoft support suggests disabling all permissions except "Enable sign-on and read users' profiles", apparently to avoid permission related problems. I understand that this is not a solution in your case, but at least it gives you a test case.

Resources