DanielChronlund / DCToolbox

Tools for Microsoft cloud fans
309 stars 52 forks source link

MSAL module issue when enabling Entra ID role #43

Open pawelpvl opened 9 months ago

pawelpvl commented 9 months ago

Hi,

I have not found such an issue on the issues page. Could you please help with the issue below?

image

vuwdalderman commented 2 months ago

I think this is because the RedirectUri parameter on the Get-MsalToken is set to "urn:ietf:wg:oauth:2.0:oob" which has been deprecated. The RedirectUri can be http://localhost like this:

# Get token for MS Graph by prompting for MFA.
$MsResponse = Get-MsalToken -Scopes @('https://graph.microsoft.com/.default') -ClientId "14d82eec-204b-4c2f-b7e8-296a70dab67e" -RedirectUri "http://localhost" -Authority 'https://login.microsoftonline.com/common' -Interactive -ExtraQueryParameters @{claims = '{"access_token" : {"amr": { "values": ["mfa"] }}}' }