icinga-powershell-framework/lib/webserver/Send-IcingaWebAuthMessage.psm1
Lord Hepipud 4ef55bddb4 Fixes lots of code styling, spelling and script analyzer
Disabling UseConsistentIndentation because it is not
properly working for multi-line commands with arguments
and array/hashtable objects
2022-01-14 22:26:53 +01:00

32 lines
857 B
PowerShell

<#
.SYNOPSIS
Sends a basic auth request back to the client
.DESCRIPTION
Sends a basic auth request back to the client
.FUNCTIONALITY
Sends a basic auth request back to the client
.EXAMPLE
PS>Send-IcingaWebAuthMessage -Connection $Connection;
.PARAMETER Connection
The connection data of the Framework containing the client and stream object
.INPUTS
System.Hashtable
.OUTPUTS
Null
.LINK
https://github.com/Icinga/icinga-powershell-framework
#>
function Send-IcingaWebAuthMessage()
{
param (
[Hashtable]$Connection = @{ }
);
Send-IcingaTCPClientMessage -Message (
New-IcingaTCPClientRESTMessage `
-HTTPResponse ($IcingaHTTPEnums.HTTPResponseType.Unauthorized) `
-ContentBody 'Please provide your credentials for login.' `
-BasicAuth
) -Stream $Connection.Stream;
}