Skip to content

User auth flow backwards-(in)compatibility #2218

Closed

Description

@vito

This issue will track backwards-incompatible changes made as part of the transition to Dex (#1888).

We'll decide here how/whether to resolve them and/or just document them.

fly set-team flags UX

Currently there are new flags for configuring things like GitHub auth, in the form of --github-group org:team. This is a little confusing since it introduces a "group" term, and it's unclear whether it's a Concourse concept, a Dex concept, a GitHub concept, or a general term. I think we should just keep the flags as-is and convert them under the hood to whatever format is appropriate.

There are some flags that no longer make sense to configure in fly set-team - notably, the client ID/secret and auth URL endpoints. Let's just remove these. The resolution on the user's end is simple - just stop passing them. The rest of the flags can then stay the same.

We restored the UX to how it was before, caveat being that some flags are now globally-configured.

No longer able to have "no auth"

Now that logging in us user-centric, you have to log in as someone. The --no-really-i-dont-want-any-auth flag is no more. We're OK with this, and will just change Quick Start, tests, and other reference material to just configure a dummy username and password, or even encourage configuring things like GitHub auth. This is probably better in the long run anyway.

Activity

  1. jwntrs commented on May 14, 2018

    @jwntrs
    Contributor

    @vito We can definitely revert the github-group to something more github-y like github-org and github-team, but in general, instead of remaining backwards compatible (since we're already breaking the set-team command interface) maybe we could re-evaluate these flags and come up with something that makes sense. We've kind of strayed with some of our current naming.

    Our first pass at something more uniform looks like this:

        Authentication:
              --local-user=USERNAME                List of whitelisted local concourse users. These are the users you've added at atc startup with the --add-local-user flag.
              --allow-all-users                    Setting this flag will whitelist all logged in users in the system. ALL OF THEM. If, for example, you've configured GitHub, any user with a GitHub account will have access to your team.
    
        Authentication (CloudFoundry):
              --cf-user=USERNAME                   List of whitelisted CloudFoundry users.
              --cf-group=ORG_NAME:SPACE_NAME       List of whitelisted CloudFoundry groups (e.g. my-org or my-org:my-space)
    
        Authentication (GitHub):
              --github-user=USERNAME               List of whitelisted GitHub users
              --github-group=ORG_NAME:TEAM_NAME    List of whitelisted GitHub groups (e.g. my-org or my-org:my-team)
    
        Authentication (GitLab):
              --gitlab-user=USERNAME               List of whitelisted GitLab users
              --gitlab-group=GROUP_NAME            List of whitelisted GitLab groups
    
        Authentication (LDAP):
              --ldap-user=USERNAME                 List of whitelisted LDAP users
              --ldap-group=GROUP_NAME              List of whitelisted LDAP groups
    
        Authentication (OAuth2):
              --oauth-user=USERNAME                List of whitelisted OAuth2 users
              --oauth-group=GROUP_NAME             List of whitelisted OAuth2 groups
    
        Authentication (OIDC):
              --oidc-user=USERNAME                 List of whitelisted OIDC users
              --oidc-group=GROUP_NAME              List of whitelisted OIDC groups
    
  2. jwntrs commented on May 14, 2018

    @jwntrs
    Contributor

    New arguments to fly set-team

    @vito Is this more in line with what you were thinking?

        Authentication (CloudFoundry):
              --cf-user=USERNAME                  List of whitelisted CloudFoundry users.
              --cf-org=ORG_NAME                   List of whitelisted CloudFoundry orgs
              --cf-space=ORG_NAME:SPACE_NAME      List of whitelisted CloudFoundry spaces
    
        Authentication (GitHub):
              --github-user=USERNAME              List of whitelisted GitHub users
              --github-org=ORG_NAME               List of whitelisted GitHub orgs
              --github-team=ORG_NAME:TEAM_NAME    List of whitelisted GitHub teams
    
  3. jwntrs commented on May 14, 2018

    @jwntrs
    Contributor

    Another thing to add here is that we can't really support gitlab until further notice. Although technically this isn't a breaking change since it's already broken. More info here #2207.

  4. jwntrs commented on May 29, 2018

    @jwntrs
    Contributor

    Don't support multiple instances of the same provider

    We recently discussed the fact that you can't add multiple providers of the same type in the new auth system. This means after the update, you can only have one set of configuration for each provider. This could pose a problem, if users have different teams that are integrating with different versions of the same provider. In order to maintain the "at most one provider per concourse" constraint, migrating will fail whenever there are multiple teams with using different configurations of the same provider type.

    The obvious solution for these cases is to deploy multiple concourse foundations.

  5. jwntrs commented on May 30, 2018

    @jwntrs
    Contributor

    Changes to the bosh manifest

    We've made a few changes to the bosh deployment manifest.

    In the old manifest you could configure your main team's auth provider with the following options:

    no_really_i_dont_want_any_auth: true
    
    basic_auth_username: some-username
    basic_auth_password: some-password
    
    github_auth:
      client_id: some-client-id
      client_secret: c29tZS1jbGllbnQtc2VjcmV0Cg==
      auth_url: https://example.com/auth
      token_url: https://example.com/token
      api_url: https://example.com/api
      authorize:
      - organization: some-org
        teams: [some-team]
      - user: some-user
    
    uaa_auth:
      client_id: some-client-id
      client_secret: c29tZS1jbGllbnQtc2VjcmV0Cg==
      auth_url: https://example.com/auth
      token_url: https://example.com/token
      cf_spaces: [some-space-guid]
      cf_api_url: https://example.com/api
      cf_ca_cert: |
        -----BEGIN CERTIFICATE-----
        ...
        -----END CERTIFICATE-----
    
    generic_oauth:
      client_id: some-client-id
      client_secret: c29tZS1jbGllbnQtc2VjcmV0Cg==
      auth_url: https://example.com/auth
      auth_url_params:
        some-param: some-value
      scope: some-scope
      token_url: https://example.com/token
      display_name: some-provider-name
      ca_cert: |
        -----BEGIN CERTIFICATE-----
        ...
        -----END CERTIFICATE-----
    

    In the new manifest you'll have to make some changes to separate the provider configuration from the user/group whitelisting for the main team:

    add_local_users:
    - some-user:$2a$10$sKZelZprWWcBAWbp28rB1uFef0Ybxsiqh05uo.H8EIm0sWc6IZGJu
    - some-other-user:$2a$10$.YIYH.5EWQcCvfE49xH/.OhIhGFiNtn.tQq.4pznpcrqZvoLxuKeC
    
    github_auth:
      client_id: some-client-id
      client_secret: c29tZS1jbGllbnQtc2VjcmV0Cg==
      host: github.example.com
      ca_cert: |
        -----BEGIN CERTIFICATE-----
        ...
        -----END CERTIFICATE-----
    
    cf_auth:
      client_id: some-client-id
      client_secret: c29tZS1jbGllbnQtc2VjcmV0Cg==
      api_url: https://example.com/api
      ca_cert: |
        -----BEGIN CERTIFICATE-----
        ...
        -----END CERTIFICATE-----
    
    generic_oauth:
      client_id: some-client-id
      client_secret: c29tZS1jbGllbnQtc2VjcmV0Cg==
      auth_url: https://example.com/auth
      token_url: https://example.com/token
      userinfo_url: https://example.com/userinfo
      scopes: [some-scope]
      groups_key: groups
      display_name: some-oauth-provider
      ca_cert: |
        -----BEGIN CERTIFICATE-----
        ...
        -----END CERTIFICATE-----
    
    generic_oidc:
      client_id: some-client-id
      client_secret: c29tZS1jbGllbnQtc2VjcmV0Cg==
      issuer: https://example.com
      scopes: [some-scope]
      groups_key: groups
      display_name: some-oidc-provider
      ca_cert: |
        -----BEGIN CERTIFICATE-----
        ...
        -----END CERTIFICATE-----
    
    main_team:
      allow_all_users: true
      local:
        users: [some-user]
      github:
        users: [some-github-login]
        orgs: [some-org]
        teams: [some-other-org:some-team]
      cf:
        users: [some-cf-username]
        orgs: [some-org-name]
        spaces: [myspace-guid-1C51B42EB333, myorg-name:myspace-name]  # <-- supports org:space names and/or space_guid
      oauth:
        users: [some-oauth-user]
        groups: [some-oauth-group]
      oidc:
        users: [some-oidc-user]
        groups: [some-oidc-group]
    
  6. jwntrs commented on Jun 25, 2018

    @jwntrs
    Contributor

    Fly login (and as a result sync) won't work

    Older versions of fly will not be able to login to the new version of concourse. Sync doesn't require authentication, but it does need a target to be set. Currently the only way to set a target is to login, which means sync depends on login. However, if you have an existing target kicking around you can do a sync even if your token has expired.

    This is all a very roundabout way of saying that sync might not work, in which case you'd have to download a new version of the CLI from the web interface.

  7. jwntrs commented on Jun 26, 2018

    @jwntrs
    Contributor

    Check your database before migrating

    There are lots of reasons that we fail the database migration, so you might want to check your team auth before starting an upgrade. This was posted in #1888 but posting again here to make sure it gets captured in the release notes.

    We're going to fail the up migration if:

    • you're using bitbucket, sorry it's no longer supported 😢
    • you have teams that use different configuration for the same provider type (e.g. two teams targeting different github enterprises).
    • you have more than one team using the same basic auth username

    We're going to fail the down migration (which we don't officially support btw) if:

    • you change any of your teams' auth (other than the main team) or add any new teams.
  8. jwntrs commented on Jun 26, 2018

    @jwntrs
    Contributor

    ### Update your client's redirect_url

    You will need to update your client redirect_url. In the past if you were using github it would have looked like https://some-host/auth/github/callback. Now, regardless of what provider you're using, it should redirect back to https://some-host/sky/issuer/callback

    We've setup a redirect handler which routes /auth/{provider}/callback to /sky/issuer/callback

  9. vito commented on Jun 28, 2018

    @vito
    ContributorAuthor

    @pivotal-jwinters

    Two requests before we ship this (I think it should be 4.0 since it requires every user to change how they deploy):

    Namespace main team BOSH properties under auth.

    I think we should namespace the BOSH properties a bit - it could get hairy in the future when there's more to configure on a team than just auth (e.g. Vault config per concourse/rfcs#5).

    How about:

    main_team:
      auth:
        allow_all_users: true
        local:
          users: [some-user]
        github:
          users: [some-github-login]
          orgs: [some-org]
          teams: [some-other-org:some-team]
        cf:
          users: [some-cf-username]
          orgs: [some-org-name]
          spaces: [myspace-guid-1C51B42EB333, myorg-name:myspace-name]  # <-- supports org:space names and/or space_guid
        oauth:
          users: [some-oauth-user]
          groups: [some-oauth-group]
        oidc:
          users: [some-oidc-user]
          groups: [some-oidc-group]

    Tidy up URLs

    I'd like to minimize the exposure of internal components like 'skymarshal' when it comes to URLs. If we refactor or rename internal components (who knows if Dex goes away in the future), I don't want that to require everyone to change links (like /login) and externally configured callback URLs (like /auth/github/callback). I don't really care about URLs the user doesn't knowingly interact with (I see Dex has a lot going on during the login dance), I just want to minimize breakage both this time and next time we revamp our auth implementation.

    The main URLs I care about are /login (because people browse directly to it and may link to it/bookmark it) and /auth/X/callback (because external providers are configured with it and if it's not working no one can log in). I don't particularly care if we have to get them working by doing redirects or manual shims.

    I see for example that if I go to /sky/login I get redirected to /sky/issuer/auth with a bunch of gobbeldigook on the end. That's OK, though I'd like to see just /login instead.

    The callback URL may be a bit more tricky. It looks like the new callback URL makes no mention of the provider ("github"), which was required before but I guess isn't anymore. Does it hurt to include it anyway? If it went from "required" to optional it's possible it becomes required again in the future. So in the interest of minimizing user intervention, could we keep that information in the new URL even though Dex doesn't need it? Could we have a general "auth callback endpoint" that now proxies to skymarshal/dex/whatever?

  10. modified the milestone: v4.0.0 on Jul 16, 2018
  11. modified the milestone: v4.0.0 on Jul 25, 2018
  12. modified the milestones: v4.0.0, , v5.0.0 on Jan 7, 2019
  13. modified the milestones: v5.0.0, v4.0.0 on Jan 18, 2019
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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions