Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 946 Bytes

README.md

File metadata and controls

37 lines (23 loc) · 946 Bytes

PowerShell Http Listener

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

Install from github.com

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

Example use

$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)"