Skip to content

Forward auth blocks Connect OAuth discovery, token, and Bearer requests #380

Open

Description

@dbkegley

Context: posit-dev/publisher#4436 (comment)

On sites with use_traefik_forward_auth: true, the proxy redirects Connect OAuth requests to Okta. OAuth clients such as Publisher then cannot discover or use the Connect OAuth server. Connect treats these endpoints as public, so the proxy must allow them.

The rules are hard-coded in buildTraefikForwardAuthHelmConfig in lib/steps/clusters_aws.go.

Anonymous requests to pub.demo.posit.team give these results:

Request Result
GET /.well-known/oauth-authorization-server 307 to Okta
POST /oauth/v1/token 307 to Okta
Authorization: Key ... reaches Connect
Authorization: Bearer ... 307 to Okta

Proposed change

For the pub. and pub- hosts:

  • Add to ptd-pub-public: Path(/.well-known/oauth-authorization-server), PathPrefix(/.well-known/oauth-protected-resource), and /oauth/v1/register, /oauth/v1/token, /oauth/v1/revoke, /oauth/v1/device/authorize.
  • Change the ptd-pub header regex from ^Key .* to ^(Key|Bearer) .*.

Keep /oauth/v1/authorize and /oauth/v1/device/verify behind Okta, because a person uses them in a browser.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions