PowerShell bindings for System.Net.HttpListener
Used by Ubisecure.OAuth2
These commands are intendend to support Loopback Interface Redirection as defined in OAuth 2.0 for Native Apps
https://tools.ietf.org/html/draft-ietf-oauth-native-apps-12#section-7.3
Windows
cd /d %USERPROFILE%\Documents\WindowsPowerShell\Modules
git clone https://github.com/psteniusubi/Ubisecure.HttpListener.git
Linux
cd ~/.local/share/powershell/Modules
git clone https://github.com/psteniusubi/Ubisecure.HttpListener.git
$listener = Start-HttpListener -Prefix "http://localhost/application/redirect/" -RandomPort
Start-Process $listener.Prefix | Out-Null
$request = $listener | Read-HttpRequest | Write-HttpResponse -Body "<p>Hello World</p>" -Stop -PassThru
Write-Host "$($request.HttpMethod) $($request.Url)"