You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've added HTTP basic authentication to a single route, via a JSON users file.
When I attempt to load the route in my web browser, I get the following error on the Pode server.
Date: 2022-09-07 01:41:23
Level: Error
ThreadId: 1
Server: codespaces-8cac4e
Category: InvalidData: (:) [Invoke-PodeScriptBlock], ParameterBindingValidationException
Message: Cannot validate argument on parameter 'Value'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
StackTrace: at <ScriptBlock>, /home/codespace/.local/share/powershell/Modules/Pode/2.7.1/Private/Authentication.ps1: line 729
at Invoke-PodeScriptBlock, /home/codespace/.local/share/powershell/Modules/Pode/2.7.1/Public/Utilities.ps1: line 642
at <ScriptBlock>, /home/codespace/.local/share/powershell/Modules/Pode/2.7.1/Private/Authentication.ps1: line 1163
at Invoke-PodeScriptBlock, /home/codespace/.local/share/powershell/Modules/Pode/2.7.1/Public/Utilities.ps1: line 634
at Invoke-PodeMiddleware, /home/codespace/.local/share/powershell/Modules/Pode/2.7.1/Private/Middleware.ps1: line 45
at <ScriptBlock>, <No file>: line 87
Steps To Reproduce
Pode
Start-PodeServer-ScriptBlock {
Add-PodeEndpoint-Address 0.0.0.0-Port 8080-Protocol Http
New-PodeAuthScheme-Basic |Add-PodeAuthUserFile-Name Login -Sessionless
Add-PodeRoute-Method Get -Authentication Login -Path /nameform -ScriptBlock {
Write-PodeHtmlResponse-Value @'<form action = "/name" method = "post"> <input id = "username" type = "text" /> <input id = "password" type = "password" /> <input type = "submit" value = "Create Name" /></form>'@
}
}
I just tried this myself, and it worked as expected 🤔. Does Chrome for you show the credentials pop-up? The line the error is being thrown on suggests there's no password being sent for the basic auth.
(I replaced the password in your example file with UNhY4JhezH9gQYqvDMWrWH9CwlcKiECVqejMrND2VFw=, which is just "example")
@Badgerati I was having the same issue. If your password works, can you share the code you are your passwords?
Would be great to receive an example for both SHA256 and SHA256+HMAC.
Thanks!
@Badgerati I was having the same issue. If your password works, can you share the code you are your passwords? Would be great to receive an example for both SHA256 and SHA256+HMAC. Thanks!
I think it would be great to link the documentation with issue928 (answer to how to generate a password). The reason is that if someone is looking at a different hasher, such as an online sha256 hasher, the hashed value is not the same.
Describe the Bug
I've added HTTP basic authentication to a single route, via a JSON users file.
When I attempt to load the route in my web browser, I get the following error on the Pode server.
Steps To Reproduce
Pode
users.json
Expected Behavior
User authentication should work properly.
Platform
The text was updated successfully, but these errors were encountered: