Skip to content

Fly CLI - Login Behavior #1932

Closed
Closed

Description

@Rkiouak

Hi there!

Please pick the appropriate section (Feature Request or Bug Report) and delete the rest of this. Note that "missing support for X" is a feature request, not a bug!

Feature Request

What challenge are you facing?

Silent/unclear failure on fly login attempt

When running:

fly -t ci login -c http://myurl.ci
fly -t ci set-team --team-name mr-test --basic-auth-username mr --basic-auth-password mr
fly -t ci login -c http://myurl.ci
logging in to team 'main'

username: concourse
password:

target saved
$ fly -t ci set-team --team-name mr-test-2 --basic-auth-username mr --basic-auth-password mr
Team Name: mr-test-2
Basic Auth: enabled
Bitbucket Cloud Auth: disabled
Bitbucket Server Auth: disabled
GitHub Auth: disabled
GitLab Auth: disabled
UAA Auth: disabled
Generic OAuth: disabled
apply configuration? [yN]: y
error: Unexpected Response
Status: 405 Method Not Allowed
Body:
Method Not Allowed

Instead I should run (note the https vs http):

fly -t ci login -c https://myurl.ci
fly -t ci set-team --team-name mr-test --basic-auth-username mr --basic-auth-password mr
fly -t ci login -c https://myurl.ci
logging in to team 'main'

username: concourse
password:

target saved
$ fly -t ci set-team --team-name mr-test --basic-auth-username mr --basic-auth-password mr
Team Name: mr-test
Basic Auth: enabled
Bitbucket Cloud Auth: disabled
Bitbucket Server Auth: disabled
GitHub Auth: disabled
GitLab Auth: disabled
UAA Auth: disabled
Generic OAuth: disabled
apply configuration? [yN]: y
team created

A Modest Proposal

It's not immediately clear to me whether or not the login cmd ought to fail, or if its appropriate for it to return as if it were successful, and then fail on the create team. As a new naive user it appears that the login cmd is failing silently.

Activity

  1. vito commented on Jan 15, 2018

    @vito
    Contributor

    This seems strange. I'm not sure where the 405 error could be coming from. The API should work fine over HTTP and HTTPS (though obviously we recommend HTTPS) and permit both flows.

    In fact, this works fine for me:

    ~/w/c/s/g/c/atc (master) $ fly -t cinsecure l -c http://ci.concourse.ci
    logging in to team 'main'
    
    1: GitHub
    2: Basic Auth
    choose an auth method: 1
    navigate to the following URL in your browser:
    
        https://ci.concourse.ci/auth/github?team_name=main&fly_local_port=38738
    
    or enter token manually: 
    target saved
    ~/w/c/s/g/c/atc (master) $ fly -t cinsecure st -n delete-me --basic-auth-username a --basic-auth-password b
    Team Name: delete-me
    Basic Auth: enabled
    Bitbucket Cloud Auth: disabled
    Bitbucket Server Auth: disabled
    GitHub Auth: disabled
    GitLab Auth: disabled
    UAA Auth: disabled
    Generic OAuth: disabled
    apply configuration? [yN]: y
    team created
    

    Are you sure there's not a load balancer somewhere in the stack redirecting HTTP to HTTPS and confusing the CLI?

  2. self-assigned this
    on Apr 8, 2019
  3. jama22 commented on Apr 8, 2019

    @jama22

    Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions