Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2df5aee
Update apps_sample.csv
VVargaOI Dec 15, 2022
a0f63ff
Update sqlstudio.au3
VVargaOI Feb 1, 2023
15aed2a
Merge branch 'master' of https://github.com/VVargaOI/SafeguardAutomation
VVargaOI Feb 1, 2023
2d4da59
Update apps_sample.csv
VVargaOI Feb 1, 2023
bfe5173
Merge branch 'master' of https://github.com/VVargaOI/SafeguardAutomation
VVargaOI May 5, 2023
f691614
web_generic TOTP support
VVargaOI May 5, 2023
0085e0e
Update AppsSample-7.0.csv
VVargaOI May 5, 2023
d1181eb
Update web_generic.au3
VVargaOI May 5, 2023
3fd1c9c
web_generic support for AWS
VVargaOI May 9, 2023
b561a2c
Merge branch 'OneIdentity:master' into master
VVargaOI Jun 15, 2023
539c8d8
Update web_generic.au3
VVargaOI Jun 15, 2023
1e80fee
Update AppsSample-7.0.csv
VVargaOI Jun 15, 2023
c95cfa2
Skip webdriver lib version check over Internet
VVargaOI Oct 31, 2023
cab8b81
Allow wbedriver configuration via wd.conf file
VVargaOI Oct 31, 2023
565911e
Create browser_driver_update.ps1
VVargaOI Feb 21, 2024
0cd3568
Update browser_driver_update.ps1
VVargaOI Feb 21, 2024
225c7be
Deprecating AutoIT for web application credential injection
VVargaOI Nov 26, 2024
e364285
Deprecating AutoIT for web application credential injection
VVargaOI Nov 26, 2024
aaf0ee7
Update AppsSample-7.0.csv
VVargaOI Nov 26, 2024
852f177
Webgenericcdp initial commit
VVargaOI May 6, 2025
c6d331f
Update README.md
VVargaOI May 6, 2025
355bb3f
Update README.md
VVargaOI May 6, 2025
19b9568
Update README.md
VVargaOI May 6, 2025
19bdc97
webgenericcdp 1.0
VVargaOI Jul 30, 2025
3d6c41f
Update README.md
VVargaOI Jul 30, 2025
ed708ad
Update README.md
VVargaOI Jul 30, 2025
42f6e72
Update README.md
VVargaOI Jul 30, 2025
19d57b7
Update README.md
VVargaOI Jul 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions RDP Applications/AutoIt/Deprecated - web_Okta/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# DEPRECATED
For various reasons RDP Application launching for web applications based on AutoIT has been deprecated.

The primary suggestion is to use the Go-based implementation: https://github.com/OneIdentity/SafeguardAutomation/tree/master/RDP%20Applications/Go%20chromedp

In case you need to inject credentials into web applications accessed through Firefox, the AutoIT code could be ported e.g. to C# and Selenium, or other preferred method.
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# DEPRECATED
For various reasons RDP Application launching for web applications based on AutoIT has been deprecated.

The primary suggestion is to use the Go-based implementation: https://github.com/OneIdentity/SafeguardAutomation/tree/master/RDP%20Applications/Go%20chromedp

In case you need to inject credentials into web applications accessed through Firefox, the AutoIT code could be ported e.g. to C# and Selenium, or other preferred method.

# Web Application login for SPS
Only for demo use.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# DEPRECATED
For various reasons RDP Application launching for web applications based on AutoIT has been deprecated.

The primary suggestion is to use the Go-based implementation: https://github.com/OneIdentity/SafeguardAutomation/tree/master/RDP%20Applications/Go%20chromedp

In case you need to inject credentials into web applications accessed through Firefox, the AutoIT code could be ported e.g. to C# and Selenium, or other preferred method.

# Web Application login for arbitrary web applications
Only for demo use.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,295 @@
################
# Code is delivered "AS IS". Any issues encountered can be reported on Github and contributors will make a best effort to resolve them.
################
#
# Update browser driver to the latest stable release
# It does not check what browser version is installed, it just downloads the latest stable driver
# If there is no driver file on the specified path, the script also downloads the latest stable one and copies it to the specified path
#
#########
# USAGE:
# Configure the desired driver path below at VARIABLES per each browser type, then then run the script in PowerShell for the specified browser type
# .\browser_driver_update.ps1 <chrome|edge|firefox>


param(
[Parameter(Mandatory=$true)]
[string] $browser
)


#########
# VARIABLES
#
# Platform can be: win32, win64
$platform="win64"
#
# Configure the path for the driver
# The running user must have RW permissions in the folder
# If the file already exits, the script will compare its version to the latest available driver and overwrite the existing one if a newer one is available
# You can define multiple path, one per browser type, and the script will update the one given as argument
switch ($browser) {
"chrome" {
$driverpath="C:\<YOUR-PATH-HERE>\chromedriver.exe"
}

"edge" {
$driverpath="C:\<YOUR-PATH-HERE>\msedgedriver.exe"
}

"firefox" {
$driverpath="C:\<YOUR-PATH-HERE>\geckodriver.exe"
}

default {
Write-Error "Browser parameter must either be 'chrome', 'edge', or 'firefox'"
exit 1
}
}

$driverFolder = Split-Path -Parent $driverPath


#########
# FUNCTIONS

function getDriverVersion {
param (
[Parameter(Mandatory=$true)]
[string] $browser
)

Switch ($browser) {
"chrome" {
try {
return Invoke-Expression "& '$driverpath' --version"
}
catch {
return "Can't identify driver version, maybe a wrong file path is given? Let's just download the latest stable driver"
}
}

"edge" {
try {
return Invoke-Expression "& '$driverpath' --version"
}
catch {
return "Can't identify driver version, maybe a wrong file path is given? Let's just download the latest stable driver"
}

}

"firefox" {
try {
return $(Invoke-Expression "& '$driverpath' --version")[0]
}
catch {
return "Can't identify driver version, maybe a wrong file path is given? Let's just download the latest stable driver"
}
}


}
}

#function getBrowserVersion {
# param (
# [Parameter(Mandatory=$true)]
# [string] $browser
# )

# Switch ($browser) {
# "chrome" {
# $installed = gwmi cim_datafile -Filter {Name='C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'}
# return $installed.Version
# }

# "edge" {
#TODO
# }

# "firefox" {
#TODO
# }


# }
#}

function getLatestStableDriverVersion {
param (
[Parameter(Mandatory=$true)]
[string] $browser
)

Switch ($browser) {
"chrome" {
return Invoke-RestMethod -Uri "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE" -Method Get
}
"edge" {
$latestStableVersionFile = $driverFolder + "\msedgedriver_LATEST_STABLE.txt"
Invoke-RestMethod -Uri "https://msedgedriver.azureedge.net/LATEST_STABLE" -Method Get -OutFile $latestStableVersionFile
$stableVersion = Get-Content -Path $latestStableVersionFile -TotalCount 1
Remove-Item -Force -Path $latestStableVersionFile
return $stableVersion
}

"firefox" {
$latestGecko = Invoke-RestMethod -Uri "https://api.github.com/repos/mozilla/geckodriver/releases/latest" -Method Get
return $latestGecko.name
}


}

}

function getDownloadUrl {
param (
[Parameter(Mandatory=$true)]
[string] $browser,
[Parameter(Mandatory=$true)]
[string] $version
)

Switch ($browser) {
"chrome" {

$uri = "https://googlechromelabs.github.io/chrome-for-testing/"+$version+".json"
$downloads = Invoke-RestMethod -Uri $uri -Method Get
foreach ($_ in $downloads.downloads.chromedriver) {
if ($_.platform -eq $platform) {
return $_.url
}
}
Write-Error "Download URL not found for platform:"$platform
exit 1
}

"edge" {
return "https://msedgedriver.azureedge.net/" + $version + "/edgedriver_" + $platform + ".zip"
}

"firefox" {
return "https://github.com/mozilla/geckodriver/releases/download/v" + $version + "/geckodriver-v" + $version + "-" + $platform + ".zip"
}


}

}

function updateDriver {
param (
[Parameter(Mandatory=$true)]
[string] $browser,
[Parameter(Mandatory=$true)]
[string] $url
)


Switch ($browser) {
"chrome" {
$driverFileName = "chromedriver.exe"
$zipPath = $driverFolder + "\chromedriver_tmp.zip"
}

"edge" {
$driverFileName = "msedgedriver.exe"
$zipPath = $driverFolder + "\msedgedriver_tmp.zip"
}

"firefox" {
$driverFileName = "geckodriver.exe"
$zipPath = $driverFolder + "\geckodriver_tmp.zip"
}




}

try {
Invoke-RestMethod -Uri $url -Method Get -OutFile $zipPath
} catch {
Write-Error "An error occured while downloading the driver package"
exit 1
}

try {

# Load compression methods
Add-Type -AssemblyName System.IO.Compression.FileSystem

# Open zip file for reading
$driverZip = [System.IO.Compression.ZipFile]::OpenRead($zipPath)
# Copy selected items to the target directory
$driverZip.Entries |
ForEach-Object -Process {
if ($_.Name -eq $driverFileName) {
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $driverPath , $true)
}
}
$driverZip.Dispose()
Remove-Item -Force -Path $zipPath


} catch {
Write-Error "An error occured while extracting the driver from the zip file"
exit 1
}

}

function trimDriverVersion {
param (
[Parameter(Mandatory=$true)]
[string] $browser,
[Parameter(Mandatory=$true)]
[string] $version
)

Switch ($browser) {
"chrome" {
return $version.Substring(13)

}

"edge" {
return $version.Substring(25)
}

"firefox" {
return $version.Substring(12)
}
}
}

#########
# SCRIPT

$driverversion=getDriverVersion($browser)
Write-Host "Installed driver:"$driverversion



$latestStableDriver=getLatestStableDriverVersion($browser)
Write-Host "Latest stable driver:"$latestStableDriver

# String comparison does not work, let's trim $driverVersion
$driverVersion = trimDriverVersion -browser $browser -version $driverVersion

if ($driverversion.StartsWith($latestStableDriver)) {
Write-Host "Installed driver matches latest stable driver. Do nothing"
exit 0
} else {
$downloadUrl = getDownloadUrl -browser $browser -version $latestStableDriver
updateDriver -browser $browser -url $downloadUrl
}

$newDriverVersion = getDriverVersion($browser)
Write-Host "New driver installed:"$newDriverVersion




60 changes: 60 additions & 0 deletions RDP Applications/AutoIt/Deprecated - web_generic/lib/UnixTime.au3
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#include <Date.au3>
#include <Array.au3>
#include <Constants.au3>

;Local $iUnixTime1 = _GetUnixTime()

;MsgBox($MB_SYSTEMMODAL, 'Seconds Since Jan, 1st, 1970 00:00:00 GMT', $iUnixTime1)

;Local $sUnixDate1 = _GetDate_fromUnixTime($iUnixTime1)
;MsgBox($MB_SYSTEMMODAL, "", $sUnixDate1)

;$sUnixDate1 = _GetDate_fromUnixTime($iUnixTime1, False)
;MsgBox($MB_SYSTEMMODAL, "", $sUnixDate1)

;$sUnixDate1 = _GetDate_fromUnixTime($iUnixTime1, False, False)
;MsgBox($MB_SYSTEMMODAL, "", $sUnixDate1)

;Local $iUnixTime2 = _GetUnixTime('2013/01/01 00:00:00')
;MsgBox($MB_SYSTEMMODAL, "", $iUnixTime2)

; Get timestamp for input datetime (or current datetime).
Func _GetUnixTime($sDate = 0);Date Format: 2013/01/01 00:00:00 ~ Year/Mo/Da Hr:Mi:Se

Local $aSysTimeInfo = _Date_Time_GetTimeZoneInformation()
Local $utcTime = ""

If Not $sDate Then $sDate = _NowCalc()

If Int(StringLeft($sDate, 4)) < 1970 Then Return ""

If $aSysTimeInfo[0] = 2 Then ; if daylight saving time is active
$utcTime = _DateAdd('n', $aSysTimeInfo[1] + $aSysTimeInfo[7], $sDate) ; account for time zone and daylight saving time
Else
$utcTime = _DateAdd('n', $aSysTimeInfo[1], $sDate) ; account for time zone
EndIf

Return _DateDiff('s', "1970/01/01 00:00:00", $utcTime)
EndFunc ;==>_GetUnixTime

;$blTrim: Year in short format and no seconds.
Func _GetDate_fromUnixTime($iUnixTime, $blTrim = True, $iReturnLocal = True)
Local $aRet = 0, $aDate = 0
Local $aMonthNumberAbbrev[13] = ["", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
Local $timeAdj = 0
If Not $iReturnLocal Then
Local $aSysTimeInfo = _Date_Time_GetTimeZoneInformation()
Local $timeAdj = $aSysTimeInfo[1] * 60
If $aSysTimeInfo[0] = 2 Then $timeAdj += $aSysTimeInfo[7] * 60
EndIf

$aRet = DllCall("msvcrt.dll", "str:cdecl", "ctime", "int*", $iUnixTime + $timeAdj )

If @error Or Not $aRet[0] Then Return ""

$aDate = StringSplit(StringTrimRight($aRet[0], 1), " ", 2)

If $blTrim Then Return StringRight($aDate[4], 2) & "/" & StringFormat("%.2d",_ArraySearch($aMonthNumberAbbrev, $aDate[1])) & "/" & $aDate[2] & " " & StringTrimRight($aDate[3], 3)

Return $aDate[4] & "/" & StringFormat("%.2d", _ArraySearch($aMonthNumberAbbrev, $aDate[1])) & "/" & $aDate[2] & " " & $aDate[3]
EndFunc ;==>_GetUnixDate
Loading