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
# 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 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 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 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 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.
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
param ( | |
$Username, | |
$Password, | |
$OperationType, | |
[bool] $usepagedimport, | |
$pagesize | |
) | |
#Needs reference to .NET assembly used in the script. |
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
Function DelegatedAuthN { | |
<# | |
.SYNOPSIS | |
Authenticate to Azure AD (using Delegated Auth) and receieve Access and Refresh Tokens. | |
.DESCRIPTION | |
Authenticate to Azure AD (using Delegated Auth) and receieve Access and Refresh Tokens. | |
.PARAMETER tenantID |
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
# Unifi Controller Login Base URI | |
$uController = 'yourControllerIP' # e.g 'https://192.168.1.2:8443' | |
# Identifier of the site in UniFi. Set to default for the default site | |
$uSiteID = "default" | |
$uUsername = 'adminuser' # yourAdmin UserID | |
$uPassword = 'yourPassword' # yourAdmin User Password | |
$uAuthBody = @{"username" = $uUsername; "password" = $uPassword } | |
$uHeaders = @{"Content-Type" = "application/json" } |
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
import msal | |
import jwt | |
import json | |
import sys | |
import requests | |
from datetime import datetime | |
from msal_extensions import * | |
graphURI = 'https://graph.microsoft.com' | |
tenantID = 'yourTenantID' |
NewerOlder