Last active
May 28, 2020 10:08
-
-
Save tabs-not-spaces/1a733e649beb72ff62a68a5270620db2 to your computer and use it in GitHub Desktop.
Intune authentication example
This file contains 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
if (!(Get-Module -Name MSAL.PS -ListAvailable -ErrorAction SilentlyContinue)) { | |
Install-Module -Name MSAL.PS -Scope CurrentUser -Force | |
} | |
$clientId = "d1ddf0e4-d672-4dae-b554-9d5bdfd93547" # well known Intune application Id | |
$auth = Get-MsalToken -ClientId $clientId -deviceCode #deviceCode requires interaction and solves MFA challenges | |
$token = @{ Authorization = $auth.CreateAuthorizationHeader() } |
Updated to use MFA.
See how easy it is?
…On Sat, 25 Apr 2020, 6:47 pm scerazy, ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Not 2FA ready
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/1a733e649beb72ff62a68a5270620db2#gistcomment-3269141>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIDA4LNHVMGWIBUNSDOOS4LROKPQNANCNFSM4MQU6PLA>
.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not 2FA ready