serenity-bdd / serenity-jira

14 stars 27 forks source link

401 authentication-error! But not with curl #107

Open digital-h opened 4 years ago

digital-h commented 4 years ago

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 = user@my-company.com jira.password = myS3cr3tApiToken

Unfortunately I receive a 401: Authentication error (401) for user user@my-company.com

If I run the same with curl, everything works fine: curl --user user@my-company.com: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 commented 4 years ago

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("user@my-company.com", "myS3cr3tApiToken")
        .build()
    clientConfig.register(feature)
wakaleo commented 4 years ago

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

digital-h commented 4 years ago

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 commented 4 years ago

Not at this stage

digital-h commented 4 years ago

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 commented 4 years ago

I’d be happy to have your collaboration - I’ll ping you when something is available

On Thu, 14 May 2020 at 08:48, Thomas H. notifications@github.com wrote:

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

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/serenity-bdd/serenity-jira/issues/107#issuecomment-628456765, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANVMV4C6XKB4JOKRDBYSTRROO3XANCNFSM4M74NGHA .

--


John Smart | Wakaleo Consulting | +44 7398 832273 Making smart teams collaborate better http://johnfergusonsmart.com | john.smart@wakaleo.com


We love breaking down silos and helping smart teams collaborate better! Ask about our tailored on-site workshops https://johnfergusonsmart.com/training/ in Agile Product Planning http://johnfergusonsmart.com/programs-courses/next-generation-agile-delivery-product-planning/, BDD Requirements Discovery http://johnfergusonsmart.com/programs-courses/mastering-agile-requirements-behaviour-driven-development/, BDD, TDD and Clean Coding http://johnfergusonsmart.com/programs-courses/bdd-tdd-clean-coding/, and Advanced BDD Test Automation http://johnfergusonsmart.com/programs-courses/advanced-bdd-test-automation/ .

Need some help with Serenity BDD? Check out our Serenity BDD training and support packages here https://johnfergusonsmart.com/serenity-bdd/.


digital-h commented 4 years ago

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

LuchoCruz commented 3 years ago

Has this been addressed already?

manishbupadhyay commented 2 years ago

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

wakaleo commented 2 years ago

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

manishbupadhyay commented 2 years ago

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

wakaleo commented 2 years ago

It depends on what you want to do with JIRA.

manishbupadhyay commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Thanks @wakaleo . I will try this.