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

401 authentication-error! But not with curl #107

Open
digital-h opened this issue May 13, 2020 · 15 comments
Open

401 authentication-error! But not with curl #107

digital-h opened this issue May 13, 2020 · 15 comments

Comments

@digital-h
Copy link

digital-h commented May 13, 2020

This might not be an issue, but more a problem to me - but I couldn't find anything better to post it.

I just integrated the latest version of the serenity-jira-plugin into my project:

`
ext {
serenityCoreVersion = '2.2.2'
serenityCucumberVersion = '2.2.2'
}

dependencies {

implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'

testImplementation "net.serenity-bdd:serenity-core:${serenityCoreVersion}"
testImplementation("net.serenity-bdd:serenity-cucumber5:${serenityCucumberVersion}") {
exclude group: 'io.cucumber', module: 'cucumber-java'
}
testImplementation "io.cucumber:cucumber-java8:5.6.0"
testImplementation "net.serenity-bdd:serenity-rest-assured:${serenityCucumberVersion}"
testImplementation "net.serenity-bdd:serenity-jira-plugin:1.12.0"
testImplementation "net.serenity-bdd:serenity-jira-requirements-provider:1.12.0"
`

My serenity.properties have been configured as follows:

jira.url = https://my-company.atlassian.net jira.project = BC jira.username = [email protected] jira.password = myS3cr3tApiToken

Unfortunately I receive a 401:
Authentication error (401) for user [email protected]

If I run the same with curl, everything works fine:
curl --user [email protected]:myS3cr3tApiToken https://my-company.atlassian.net/rest/api/latest/search

What can be the cause for that?
I work with Kotlin and therefor used the cucumber-java8, but as I'm on the jersey-level I cannot image that this conflicts in a way. Updating to latest jersey client 2.30.1 also didn`t solve it.
Any help would be appreciated

@digital-h
Copy link
Author

digital-h commented May 14, 2020

I just experienced that using the non-Preemptive works for me, but unfortunately this is not supported in this version.

val feature = HttpAuthenticationFeature.basicBuilder()
        .nonPreemptive()
        .credentials("[email protected]", "myS3cr3tApiToken")
        .build()
    clientConfig.register(feature)

@wakaleo
Copy link
Member

wakaleo commented May 14, 2020

The JIRA API has changed, so this should work in the next release

@digital-h
Copy link
Author

thanks for the quick reply. Any information on when this is going to happen? Or is there any version I can already work with?

@wakaleo
Copy link
Member

wakaleo commented May 14, 2020

Not at this stage

@digital-h
Copy link
Author

Do you have a reference to a PR/commit? Then i can cherry-pick and work with a customized version until you released it.

@wakaleo
Copy link
Member

wakaleo commented May 14, 2020 via email

@digital-h
Copy link
Author

alright! Thank you! I`m ready to assist anytime.

@LuchoCruz
Copy link

Has this been addressed already?

@manishbupadhyay
Copy link

Hi @wakaleo , is this issued addressed already? because I'm getting 401 authentication error.

@wakaleo
Copy link
Member

wakaleo commented Jan 7, 2022

No, the module needs to be updated/rewritten to work with the new JIRA APIs.

@manishbupadhyay
Copy link

Thanks @wakaleo for your quick response.
How can I work with new JIRA APIs?

@wakaleo
Copy link
Member

wakaleo commented Jan 7, 2022

It depends on what you want to do with JIRA.

@manishbupadhyay
Copy link

I am using serenity-bdd so once my script pass then I want to update my test case automatically. I've done all the steps as mentioned here https://serenity-bdd.github.io/theserenitybook/latest/jira.html. my test case is pass but I'm getting below error.

image

@wakaleo
Copy link
Member

wakaleo commented Jan 7, 2022

You can (a) wait until the plugin is updated, (b) update the plugin yourself, or (c) write your own integration code in an @after hook method.

@manishbupadhyay
Copy link

Thanks @wakaleo . I will try this.

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

4 participants