Azure AD App Read Group membership - azure

I am creating a maintenance app to read all group membership from AAD.
When I logged in as user, I am able to read all details -Users and Groups. When I use powershell to read users details - I am able to do. My user have access to read AD User and Group details.
When I try to assign the permission to AD App it needs admin consent to read other user/group details. Basically Azure Graph RBAC reading other details always need admin consent. I want to accomplish the task with my user impersonation to the AD App without asking admin consent. Multifactor authentication always block me when I try to automate it. any help!

If you're an administrator, you can also consent to an application's delegated permissions on behalf of all the users in your tenant. This will prevent the consent dialog from appearing for every user in the tenant.
You can do this from the Azure portal from your application page. From the Settings blade for your application, click Required Permissions and click on the Grant Permissions button.
More details about Grant permissions to an APP in Azure AD, refer to this document.

Related

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.

Azure B2C App Registration Scope - Can't Change "Who Can Consent" To Admins and Users

I am trying to follow tutorial to add a scope that admins and users can consent, but I don't see the option to change "Who Can Consent" to admins and users - what am I missing?
#8 here:
https://github.com/Azure-Samples/active-directory-dotnet-native-aspnetcore-v2/blob/master/1.%20Desktop%20app%20calls%20Web%20API/README-incremental.md
also no details given here:
https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-configure-app-expose-web-apis
thanks
Users are allowed to consent to any app in the Enterprise Applications -> Consent and Permissions settings...
Azure AD B2C expose API application only supports admin consent, and does not support user consent permissions. Only the api application exposed by Azure AD can choose user consent. You refer to the documentation of Azure AD rather than the documentation of Azure AD B2C. There are many documents applicable to Azure ad b2c, such as: here and here and here.
For your second doubt:
Users are allowed to consent to any app in the Enterprise Applications
-> Consent and Permissions settings....
What is said in the portal is not rigorous, the complete description should be: This option allows all users to consent to any permission which doesn't require admin consent, for any application. It just means that the user can consent to permissions that do not require the administrator's consent, not that the user can consent to any permissions.

User account does not show application assignments

Log into Azure B2C
Click Users
Select a user
Click Applications
I created users in my B2C tenant by logging into my website using various OAuth identity providers. So for any user selected using the above steps I expect to see at least one application listed - that being the one the user signed into when their user record was created in Azure.
When I perform the above steps I only see applications listed under my own user name. I created all the users I see in my tenant so I know there should be apps listed with each user name.
More formally stated my questions are:
Given an Azure AD Application, how do I get a list of users that are authorized to log into that app?
Given an Azure AD User, how do I get a list of applications that user is authorized to log into?
I would like to accomplish the above tasks using Azure portal - I don't want to write script. Also, my purpose in asking these questions is to be able to delete or disable users as needed.
Azure AD B2C does not hold a mapping of Users who signed into an App to a specific Application Registration. By default, all users are authorized to sign into your apps if you have OAuth IdPs configured against the AAD B2C policy that allows authentication to your App.
You can use the AAD B2C Sign In logs to see which users have been logging into what applications.
Assigning or not assigning Users to Apps in the Azure Portal does not enforce any authorization, this is an Azure AD only concept and doesnt apply to Azure AD B2C.
The process you followed(Users->select user->application) will only be able to see the applications listed under your tenant.
In the same manner when you choose an application and select the users/Groups you will only be able to see the users who have accessed your application.
Based on application/user->application you can remove the access from that application.
Regarding the
Given an Azure AD Application, how do I get a list of users that are
authorized to log into that app?
Given an Azure AD User, how do I get a list of applications that user
is authorized to log into?
The list of users/application authorized details are completely depend on the application consent flow.
Application developers can dictate what types of permissions are being requested and if they want to guide users through the user consent flow or the admin consent flow. If the application is provided with user consent flow based on the consent acceptance any user can access that particular application.
Admin consent flow is when an application developer directs users to the admin consent endpoint with the intent to record consent for the entire tenant. Application access grant to the requested data on behalf of the entire tenant.
For more details on the consent and permission please go through the document

What is the Grant Permissions button for Azure AD web app

This more of an admin question as far as where you might find this issue. I am working with an Azure AD web app and I am wondering what the Grant Permissions button does?
I made a test dummy MVC project to see what it did and when I grant permissions for my account for the current directory it makes the manifest unusable.
This is the view of my app in Azure AD app registrations. I've highlighted the Grant Permissions button that I am talking about.
This is the drop down I get when clicking on the Grant Permissions button. This is the part I really don't understand and need clarification on what it's doing when I say yes.
Basically, what can I do to undo the actions if I say yes to the Grant Permissions button for my app? But also, what exactly does the Grant Permissions do for my app? I am just a normal user in my Active Directory that has the ability to create apps in ad and edit the manifest.
Any help would be much appreciated and thanks in advance!
The Grant Permissions button in the Azure Portal will perform Admin Consent on the app you have selected.
Admin Consent can accomplish a multitude of things. There are two primary use cases.
If you're building a single tenant web app that calls admin and user scopes/permissions, it will consent for all users in that tenant. This will let the app call any admin scopes, and also suppress consent for all the users inside the tenant.
The other use case is to consent for app only permissions, which always requires admin consent.
The Azure AD How to build a multi tenant app doc has a great section on the meaning of admin consent.
I am not aware of any way to revoke admin consent. An individual user can revoke consent they've granted through My App.

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