Not sure if this has been asked before. I searched around but didn’t find anything.
Would this be possible? I’m trying to build a webapp for different departments to log into and see their own subscription information and the resources they have access to.
To filter UDPage out to some users only, you would then create your new-udpage the New-UDPage -AuthorizationPolicy ‘SuperAdmin’ parameter (SuperAdmin correspond to the choosen name and apply the custom condition, in this case, based on a Azure group membership claim, to your dashboard.
I’ll leave at the bottom a link to a “claims viewer” page that can help view the claim of the connected user to create those.
The other filtering you can perform is in the UDPage itself.
You can do something like :
$IsInSuperAdminGroup = $ClaimsPrinciple.claims.value.contains('16cca29e-f53e-4260-8181-74b11f2b70b1')
if ($IsInSuperAdminGroup) {
New-UDCard -Title 'Hey you' -Text 'You are a super admin !'
}
In this instance, the ud card would be shown only to users matching the specified claim (group membership or role) criteria.
Some documentation on the subject.
A helper page I made that displays the claims
Edit:
Regarding filtering within a page, I also found the following dedicated method :
It is even better than the first method I proposed altough on my end, I have an error message when I use it which might or might not be a bug in 2.5. Neverthless, both methods are valid ways to filter your page.
I also forgot to mention but by default, an Azure app. do not return group membership into claims.
In order to enable that scenario, you will need to login on the Azure portal, then go to Azure Active Directory blade / App Registrations / Your app / Manifest and set the value for groupMembershipClaims to SecurityGroup
"groupMembershipClaims": "SecurityGroup",
Only then you will receive the group membership of your user within the claims and become able to create your policies that use the groups based claims.
Thank you for showing me the claims membership. I’ve actually already used that before for another project I was working on
What I’m looking to do is request the right token for the graph or azure api so I can retrieve things like resource groups, resources and subscriptions in an Azure tenant that the current user would have access to and then display things like cost, locations, policies, etc.
Yeah I was afraid of that. I’ll try the workaround and report back! I’d like to be able to make something I can use for different customers but with one page.