Had an emergency at a customer today, where the IAM solution removed a few thousand users from licensing groups. In order to quickly add these back until the IAM system was operational again, the following method was used.
Continue reading “Script for adding back members to Azure AD group from audit log”Full IGA using Azure AD – Managing access using Entitlement Management
In this blog series on building a full Identity Governance and Administration solution, we have until now covered application roles extensively, and how these can be sent to an application.
For a quick summary, this is how you can define custom application roles, here is how to send these roles using the SCIM protocol, this article shows how to transfer the roles using the OpenID Connect ID Token or SAML claim and here I can show you how to use PowerShell to query the Microsoft Graph for application role assignments for your users and groups.
Continue reading “Full IGA using Azure AD – Managing access using Entitlement Management”Getting all direct reports from Azure AD using the batch endpoint
A quick script to get stuff from Azure AD using the batch endpoint, that can essentially let you run your scripts 10 to 20 times as fast in certain circumstances.
Continue reading “Getting all direct reports from Azure AD using the batch endpoint”Creating B2C users through the Microsoft Graph
The Microsoft Graph finally should have all functionality that previously only the Azure AD Graph had, such as the ability to create and manage B2C user accounts. Earlier you had to create them through the Azure AD Graph, in order to do certain things such as setting the account type as local and managing username.
Continue reading “Creating B2C users through the Microsoft Graph”Today i learned that querying the Microsoft Graph for the all users with manager reference is slow
What should be a fairly straight forward select is not straight forward. Talking to the product group, this is on the horizon, but right now, this must be done through slow means.
Continue reading “Today i learned that querying the Microsoft Graph for the all users with manager reference is slow”Enabling Seamless Single Sign-On when using Azure AD Connect Cloud Provisioning
Microsoft has not currently made it easy to figure out how to configure Seamless Single Sign-On when using AAD Connect Cloud Provisioning. Here is how!
Continue reading “Enabling Seamless Single Sign-On when using Azure AD Connect Cloud Provisioning”PowerShell cmdlet to get attributes not matching between two objects
This is a very quick cmdlet for getting attributes that does not match between two objects
<#
.Synopsis
Returns a list of all attributes that does not match between two objects
#>
function Get-MismatchedAttributes
{
[CmdletBinding()]
[OutputType([boolean])]
Param
(
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$false,
Position=0)]
$ReferenceObject,
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$false,
Position=1)]
$DifferenceObject,
[Parameter(Mandatory=$false,
ValueFromPipelineByPropertyName=$false,
Position=2)]
[String[]] $Attributes = $null
)
if($Attributes -eq $null) {
$Attributes = @(
$ReferenceObject | gm -MemberType NoteProperty | select -exp Name
$DifferenceObject | gm -MemberType NoteProperty | select -exp Name
) | Sort -Unique
}
$Attributes | Where {$ReferenceObject.$($_) -ne $DifferenceObject.$($_)}
}
$obj1 = [PSCustomObject] @{
Attr1 = "abc"
Attr2 = "def"
Attr3 = "klm"
}
$obj2 = [PSCustomObject] @{
Attr1 = "abc"
Attr2 = "okj"
}
Write-Host "Attributes that does not match, limited to Attr1 and Attr2" -ForegroundColor Red
Get-MismatchedAttributes $obj1 $obj2 -Attributes "Attr1","Attr2"
Write-Host "All attributes that does not match" -ForegroundColor Red
Get-MismatchedAttributes $obj1 $obj2
Testing the AAD authentication for Windows VMs preview
Quick blogpost about the experience of AAD authentication for Windows VMs – https://docs.microsoft.com/en-us/azure/active-directory/devices/howto-vm-sign-in-azure-ad-windows
Continue reading “Testing the AAD authentication for Windows VMs preview”Quick PowerShell cmdlet to get query parameters sent to localhost
When testing Azure AD applications or showing of things such as implicit flow, authorization code flow etc., it can be very useful to have a listener going on localhost in order to provide the browser a valid redirect url. The following cmdlet can be used to do this, without the need to install anything.
function Get-HttpQueryParametersSentToLocalhost
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$false,
ValueFromPipelineByPropertyName=$true,
Position=0)]
[int] $Port = 8080,
[Parameter(Mandatory=$false,
ValueFromPipelineByPropertyName=$true,
Position=1)]
[string] $Response = "Done"
)
$listener = New-Object System.Net.HttpListener
$listener.Prefixes.Add("http://localhost:$Port/")
Write-verbose "Waiting for request at http://localhost:$Port/"
$listener.Start()
$context = $listener.GetContext()
$Content = [System.Text.Encoding]::UTF8.GetBytes($Response)
$Context.Response.OutputStream.Write($Content, 0, $Content.Length)
$Context.Response.Close()
$listener.Dispose()
$Context.Request.RawUrl -split "[?&]" -like "*=*" | foreach -Begin {$h = @{}} -Process {$h[($_ -split "=",2 | select -index 0)] = ($_ -split "=",2 | select -index 1)} -End {$h}
}
$parameters = Get-HttpQueryParametersSentToLocalhost -Verbose -Port 8080
$parameters | Out-GridView
How, try to do to http://localhost:8080/asd/?test=a&idtoken=asdd&code=123 and check out what happens in PowerShell. 🙂
Ill create a new blog post that uses this to demonstrate different OpenID Connect flows later.
Building a multi tenant Azure AD application with roles
Through this blog post I will show how to build a multi tenant Azure AD application, where your customers can control role assignments through regular Azure AD app roles that they again can manage through Azure AD Entitlement Management, Access Reviews and dynamically assigned through dynamic groups.
The point of doing this kind of implementation is that you can externalize role management to the customer’s Azure AD, so that the customer can use all the great Azure AD features that exist for governing access, rather than needing to have yet another interface (your application) for assigning roles.
Continue reading “Building a multi tenant Azure AD application with roles”