Shared access to app registrations on apps.dev.microsoft.com? - azure-active-directory

I have recently registered an app using the new Microsoft registration portal located at apps.dev.microsoft.com, and it all is working great.
However, I am concerned that this registration is tied to my personal account. I would like to grant access to these app registrations to other members of my team. Is this possible?

It sounds like when you signed in to the App Registration portal, you used your personal Microsoft account, which ties this only to your personal account.
You can do what you want, but you will have to re-register your app using a "work or school" organizational account instead (i.e. Azure AD), and then you can add other users in your organization as additional "owners" of the app.
Sign in to https://apps.dev.microsoft.com using your work or school account.
Register your app, and copy your Application ID. Because you're signed in with an organizational account, this will result as a new Application object in your organization's Azure AD tenant.
Use Azure AD PowerShell to add other owners to the Application object. (Note: Normally I would suggest you use the Azure portal's "App registration" functionality for this, but that view currently filters out apps registered in the App Registration portal.)
$AppId = "dc9bc6e6-9893-476f-884f-8bbc1e61f7c5" # <- Your app's Application ID
$OtherUsername = "bob#contoso.com" # <- Other user who should also own the app
Connect-AzureAD # <-- Sign in with your organizational account
$app = Get-AzureADApplication -Filter "appId eq '$AppId'"
$user = Get-AzureADUser -Filter "userPrincipalName eq '$OtherUsername'"
Add-AzureADApplicationOwner -ObjectId $app.ObjectId -RefObjectId $user.ObjectId
Verify that now both you and the new user are owners of the Application object:
Get-AzureADApplicationOwner -ObjectId $app.ObjectId
Now, when the team member you added as an app owner signs in to the App Registration portal (using their organizational account), they will be able to see the app registration.

Related

User Assignment in Azure App registration

So, I have a WPF application, and I wanted to integrate SSO to it.
I successfully made it with "App registration" under Azure.
But now I have a problem, the users under the Azure AD can successfully connect to the app, but I want to specify which users in my AD can access to this app.
I didn't find any way to do this, and I see that in "Enterprise application" we can do so.
I wanted to know if there is any way to do it with "App registration" or if I must switch to use "Enterprise Application" and if so how can I handle the authentication in my WPF app .
In my case I use this to authenticate in the wpf app with "Tenant" and "clientId" from the app registration:
PublicClientApp = PublicClientApplicationBuilder.Create(ClientId)
.WithRedirectUri("https://login.microsoftonline.com/common/oauth2/nativeclient")
.WithAuthority(AzureCloudInstance.AzurePublic, Tenant)
.Build();
authResult = await PublicClientApp.AcquireTokenInteractive(scopes)
.ExecuteAsync();
The "registered application" is just a notification to the AAD that this application uses AAD for authentication. Once your user logs in, you can check that the user belongs to a security group that is allowed permission to use the application. There may be a better way to do this, but I check in the application itself.
To grant access only for a specific subset of users/groups in Azure AD you should create "Enterprise Application" and assign necessary users/groups to it like in this example.
Also you will need to configure single sign-on (SSO) and ensure that app's "User assignment required" property is enabled. All the steps are described here

Use Azure Managed Identity to authenticate against App Service

I have a .NET Azure App Service with Web API endpoints protected by [Authorize], and a corresponding App Registration. This works fine and allows Azure AD user accounts to access the API.
Now I want to build a Logic App that accesses the Web API under its system-assigned Managed Identity, but this results in a 403 (Forbidden).
I have enabled the system-assigned Managed Identity for the Logic App, and in the authentication parameters of the HTTP connector, I entered the App Registration's resource ID (api://<guid>) in the "Audience" field.
What is missing?
I found out what was missing.
I had to add an App Role to the app registration with "allowed member types" set to "Applications".
Then I added a service app role assignment with Azure Powershell:
Connect-AzureAD
New-AzureADServiceAppRoleAssignment -objectid {managed-identity-object-id} -principalid {managed-identity-object-id} -id {app-role-id} -resourceid {enterprise-application-object-id-of-app-service}

How to publish the registered application to the outside?

I want to make a desktop application that has [Supported account types] registered in [Accounts in any organizational directory] for application registration available to users other than my own domain.
Where can I find instructions on how to publish the registered app to the outside world?
Per my understanding, you are looking for how multi-tenant app works in other tenants.
You can do the admin consent for other tenants using the admin consent endpoint (access the following url in a browser):
https://login.microsoftonline.com/{tenant-id of other tenants}/adminconsent?client_id={client-id of the multi-tenant app}
Sign in with the admin account from other tenants to do the admin consent. This will added an enterprise app to that tenant.
Then you can use it for the authentication in those tenants.

Unable to add roles to a user in Azure AD for native app (WPF)

got a WPF app that I would like to authentication using Azure AD (got a sample that makes it work). Once authentication is done, I'd like to get a list of roles assigned to a user. I have added roles to the manifest of the app registration and saved it. I was then trying to follow this link :
Assign a user or group to an enterprise app
to assign roles to users but Users and Groups option is not available at all in the enterprise application for this app. It is available for web app, but not native. Am I missing something? Anyone knows of a good example that would authenticate user in WPF and retrieve roles (I have been looking into graph API to get user groups by so far have been unsuccessful).
Thank You
You didn't miss anything.
This is because that Native client registrations are multi-tenant by default. You don’t need to take any action to make a native client application registration multi-tenant. It means that you can sign in this application with any Users in Azure AD with some configuration. So, you wouldn't see Users and Groups in Native client in Enterprise Applications.
However,you can assign the users (without roles) to native applications by using cmdlets in PowerShell:
$appId = (Get-AzureADApplication -SearchString “<Your App's display name>”).AppId
$user = Get-AzureADUser -searchstring "<Your user's UPN>"
$servicePrincipal = Get-AzureADServicePrincipal -Filter “appId eq ‘$appId'”
New-AzureADUserAppRoleAssignment -ObjectId $user.ObjectId -PrincipalId $user.ObjectId -ResourceId $servicePrincipal.ObjectId -Id ([Guid]::Empty)
More information about the command for assigning a user to an application role, please refer to this document.

Multi tenant Daemon office 365 app registration on consumer AAD by granting admin consent, Does it also require separate registration on consumer?

I am developing a multi-tenant Office 365 daemon that requires access to user calendars.
I have successfully registered in the company tenant (Tenant1) that has deployed this app using certificates and I am able to get access tokens.
Now I created a separate AAD tenant (Tenant 2) and logged in to daemon app using administrator account of Tenant 2, it prompted the Admin Consent screen and I provided consent. There was no errors returned.
When I tried to get an app token however, I am able to get a token but with blank permissions. If I call the Office 365 API using this token, I get a 401.
I was of the view that service principal objects should be created. Also I am unable to see this app in Tenant 2 app registrations.
Do all my consumers have to register this app manually in their AD tenant and modify application manifest file to add certificate details?
I am not sure about the benefit of multi tenancy if that's the case.
I found the follow in the Azure Active Directory documentation:
The following diagram illustrates the relationship between an application's application object and corresponding service principal objects, in the context of a sample multi-tenant application called HR app. There are three Azure AD tenants in this scenario:
Adatum - the tenant used by the company that developed the HR app
Contoso - the tenant used by the Contoso organization, which is a consumer of the HR app
Fabrikam - the tenant used by the Fabrikam organization, which also consumes the HR app
You do not need to have each tenant register your application. In fact, you shouldn't since having dozens (or hundreds) of unique App IDs floating around would only create headaches for you.
Each tenant does however need to execute the Admin Consent workflow. This will authorize the App ID you've registered on your end to access the scopes you've requested.
Generally, I recommend using the v2 Endpoint and the apps.dev.microsoft.com portal for registering your app. While you can also register your app in your own Active Directory, the portal makes it a lot easier to manage.
The general process is:
Register you application in the Registration Portal
Populate the "Application Permissions" in the Microsoft Graph Permissions section.
Launch the Admin Consent workload using https://login.microsoftonline.com/common/adminconsent?client_id=[APPLICATION ID]&redirect_uri=[REDIRECT URI]
Get a beer
A couple of tips:
The Registration Portal only supports MSA (i.e. personal) accounts at the moment. I'd suggest creating a new Outlook.com account for this purpose so you can easily share the credentials with folks who need them internally.
If you create a shared Outlook.com account, you should also set up forwarding rules for all of the interested parties internally. This is in case something should every go wrong or change down the road and you need to recover the account.
I wrote a v2 Endpoint and Admin Consent primer that you might find helpful. They assume you're using the Authorization Code flow but the concepts remain the same for Client Credentials.

Resources