Skip to content

Instantly share code, notes, and snippets.

@jrotello
Created March 15, 2015 01:10
Show Gist options
  • Save jrotello/3eed0f13439f00500734 to your computer and use it in GitHub Desktop.
Save jrotello/3eed0f13439f00500734 to your computer and use it in GitHub Desktop.
Helper functions for retrieving OpenId Connect metadata from Microsoft Azure AD.
function Get-AzureADOpenIdConnectMetadata() {
param(
[string]
$tenant = "common"
)
$metadata_url = "https://login.windows.net/{0}/.well-known/openid-configuration" -f $tenant
Invoke-RestMethod $metadata_url
}
function Get-AzureADOpenIdConnectSigningKeys() {
param(
[string]
$tenant = "common"
)
$metadata = Get-OpenIdConnectMetadata $tenant
Invoke-RestMethod $config.jwks_uri | % { $_.keys }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment