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 AuthN { | |
<# | |
.SYNOPSIS | |
Authenticate to Azure AD and receieve Access and Refresh Tokens. | |
.DESCRIPTION | |
Authenticate to Azure AD and receieve Access and Refresh Tokens. | |
.PARAMETER tenantID | |
(required) Azure AD TenantID. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 AuthN { | |
<# | |
.SYNOPSIS | |
Authenticate to Azure AD and receieve Access and Refresh Tokens. | |
.DESCRIPTION | |
Authenticate to Azure AD and receieve Access and Refresh Tokens. | |
.PARAMETER tenantID | |
(required) Azure AD TenantID. |
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
<# | |
From an Admin Powershell Session install the following PowerShell Modules that are dependancies. | |
Install-Module -Name PShell-AI | |
Install-Module -Name PSAI | |
Install-Module Microsoft.Graph | |
#> | |
Import-Module -Name PShell-AI | |
Import-Module -Name PSAI |
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
# Authenticate | |
$clientID = 'myGitHubUsername' | |
# GitHub API Client Secret | |
$clientSecret = '21c22a9f0ca888373a3077614d0abcdefghijklmnop' | |
# Basic Auth | |
$Bytes = [System.Text.Encoding]::utf8.GetBytes("$($clientID):$($clientSecret)") | |
$encodedAuth = [Convert]::ToBase64String($Bytes) | |
# Search based on Description | |
$search = "Import Script" |
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
# Creds | |
$tenantID = 'yourAADTenantID' | |
$clientID = 'aadAppID' | |
$clientSecret = (ConvertTo-SecureString 'aadAppSecret' -AsPlainText -Force) | |
$accessToken = Get-MsalToken -clientID $clientID -clientSecret $clientSecret -tenantID $tenantID | Select-Object -Property AccessToken | |
# MS Graph Apps URI | |
$aadAppsURI = 'https://graph.microsoft.com/v1.0/applications' | |
# Get Expiring Creds in x Days | |
$expiryCheck = 60 |
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
import msal | |
import jwt | |
import json | |
import sys | |
import requests | |
from datetime import datetime | |
global accessToken | |
global requestHeaders | |
global tokenExpiry |
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
{ | |
"attributes": { | |
"authType": "Basic", | |
"username": "IdentityNowServiceAccount_in_ServiceNow", | |
"password": "IdentityNowServiceAccount_Password", | |
"url": "https://yourServiceNowTenant.service-now.com", | |
"serviceNowAppName" : "ServiceNow [source-42423]", | |
"catalogItem": { | |
"2c9180856a93cecd016a9ed337615c35": "a632c040db25f30033501c0e049619af" | |
} |
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
import msal | |
import jwt | |
import json | |
import sys | |
import requests | |
from datetime import datetime | |
from msal_extensions import * | |
# Microsoft Azure PowerShell Client ID | |
clientID = '1950a258-227b-4e31-a9cf-717495945fc2' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder