Azure Two-Factor Authentication from Mac Terminal

tell application "Terminal"
    activate
    tell application "System Events"
        tell application process "Terminal"
            tell menu bar 1
                click menu item "Copy" of menu "Edit"
            end tell
        end tell
    end tell
end tell

tell application "Google Chrome"
    activate
    open location "https://login.microsoftonline.com/common/oauth2/deviceauth"
    delay 2
    tell application "System Events"
        tell application process "Google Chrome"
            tell menu bar 1
                click menu item "Paste" of menu "Edit"
            end tell
        end tell
    end tell
end tell

Leave a Reply

Your email address will not be published. Required fields are marked *