Giter Site home page Giter Site logo

Authentication not working about bb HOT 12 CLOSED

derekpovah avatar derekpovah commented on May 30, 2024
Authentication not working

from bb.

Comments (12)

derekpovah avatar derekpovah commented on May 30, 2024 1

The prefix solution is super clean and it works! Thanks for all your work on this!

from bb.

craftamap avatar craftamap commented on May 30, 2024

Hey @derekpovah ,
thanks for reporting this. :) I'm gonna take a look :)

Edit: @derekpovah do you know which oauth scopes you chose while creating the app password? :)

from bb.

derekpovah avatar derekpovah commented on May 30, 2024

@craftamap I just let it do everything

from bb.

craftamap avatar craftamap commented on May 30, 2024

Alright, that sounds strange :/
The username and app password should be stored in ~/.config/bb/configuration.toml, You could check if both are set correctly there.

from bb.

derekpovah avatar derekpovah commented on May 30, 2024

It looks like everything gets set up correctly by the bb auth login command

from bb.

craftamap avatar craftamap commented on May 30, 2024

Alright :) I'm gonna spent some time later on it :)

from bb.

craftamap avatar craftamap commented on May 30, 2024

I can't reproduce this behavior on my side, sadly.

Do other bb commands still work / is only the issue command affected? bb repo view would be an easy way to get started. :)

from bb.

derekpovah avatar derekpovah commented on May 30, 2024

I found a command that outputs more than just the error message. I've updated the first comment with the output.

from bb.

craftamap avatar craftamap commented on May 30, 2024

Sorry for not taking a deeper look into this until now - however, it looks like it's related to the access token itself and not the application :/

you can verify this by running:

curl -u username:token -X GET "https://api.bitbucket.org/2.0/repositories/org/repo"

if this works, the application itself should work too :)

from bb.

derekpovah avatar derekpovah commented on May 30, 2024

It looks like the client username is getting set to my shell username and not the value in the config file. bb worked as expected when my shell user matched my Bitbucket username. My guess is something here is finding $USERNAME that's set by my shell and using it in place of the config. I wrote a fish function that always sets the --username flag to get around this for now, but it definitely feels like a hack.

echo $USERNAME
derek
(gdb) run issue list
...
:: An error occurred: 401 Unauthorized
...
(gdb) p c.Username
$1 = "derek"

(gdb) p c.Password
$2 = "xxxxxxxxxxxxxxxxxxxx"

I have never touched Go before, but I had success changing username in the config to something else. This simple solution doesn't account for existing config files that use username, though.

from bb.

craftamap avatar craftamap commented on May 30, 2024

Ahh, that meakes sense - I'm using https://github.com/spf13/viper to read the configuration and environment variables. It automatically creates them from the config parameters, so if $USERNAME is set, it will take this username instead.

I found an easy fix which will prefix all environment variables with BB_, so this should not happen anymore - I will release it within the next days :)

from bb.

craftamap avatar craftamap commented on May 30, 2024

Sorry, didn't mean to close this until you tested it - release 0.4.1 should have fixed it, though. Can you confirm?

from bb.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.