Created
March 15, 2015 01:10
-
-
Save jrotello/3eed0f13439f00500734 to your computer and use it in GitHub Desktop.
Helper functions for retrieving OpenId Connect metadata from Microsoft Azure AD.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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