Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Authentication Error Message In Case Authentication Fails #423

Open
bormm opened this issue Aug 28, 2020 · 1 comment
Open

No Authentication Error Message In Case Authentication Fails #423

bormm opened this issue Aug 28, 2020 · 1 comment

Comments

@bormm
Copy link

bormm commented Aug 28, 2020

Description

In case wrong login data is given, the cmdlets only return for example the issue was not found but do not give a correct error message.

Steps To Reproduce

In case wrong login data is given to "New-JiraSession -Credential ..." there is no error message given. Only if I pass a invalid token, a error is returned about "plain Basic authentication with passwords is deprecated".
For example a valid token for the wrong mail address is accepted without any message.
If you work a lot with JiraPS, then you will notice that there is no "Microsoft.PowerShell.Commands.WebRequestSession" object returned in case the credentials are wrong. But that's it.
The Invoke-WebRequest gets a "Client must be authenticated to access this resource." exception, but that does not result in an error message.

Later calls are unable to detect the wrong credentials, maybe because they are not passed again to the server:
For example "Get-JiraIssue "issueid"", results in "Issue does not exist or you do not have permission to see it."
Calling Get-JiraProject results in "No project could be found with key ''."
It will never mentioned the authentication failed.

Expected behavior

New-JiraSession should return an error in case jira does not accept the authentication data.

Screenshots

Your Environment

JiraPS 2.14.3

Name Value


PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Microsoft Windows 10.0.19041
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

@lipkau
Copy link
Member

lipkau commented Mar 21, 2021

I can look into this at some point.
But it's Jira REST who responds with 404 (Not Found) when you are not authorized.
This is API's best practice for avoiding scraping data without authorization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants