Commit graph

7 commits

Author SHA1 Message Date
Denis Mishin
f6ddb8878d
mcp: if upstream oauth does not return a refresh token, keep previous (#5738)
## Summary

Upstream OAuth2 providers may not return the refresh token at every
access token renewal request,
this PR ensures we do not accidentally overwrite the refresh token at
hand with an empty string.

## Related issues

Fix
https://linear.app/pomerium/issue/ENG-2619/mcp-upstream-oauth2-google-drive-did-not-return-refresh-token

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [x] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [ ] ready for review
2025-07-21 21:10:32 -04:00
Denis Mishin
b944e68232
mcp: implement connect (#5640)
## Summary

adds implementation of `/.pomerium/mcp/connect` method, that takes a
`redirect_url` parameter and would ensure the user goes thru required
redirects so that its session is hydrated with the upstream Oauth token
for the MCP server.
the `redirect_url` parameter host must match one of the _client_ mcp
routes (currently identified by the presence of `mcp:
pass_upstream_access_token: true` in the route.

## Related issues

Fix
https://linear.app/pomerium/issue/ENG-2321/mcp-support-handling-external-oauth-servers

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-06-02 17:19:34 -04:00
Denis Mishin
9d66f762e1
mcp: handle and pass upstream oauth2 tokens (#5595) 2025-05-01 12:42:31 -04:00
Denis Mishin
5b024a8ada
mcp: pass access token to the upstream (#5593) 2025-04-29 12:13:18 -04:00
Denis Mishin
daaf5b8e30
mcp: authorize: load session from the access token (#5591) 2025-04-28 16:32:06 -04:00
Denis Mishin
0602f5e00d
mcp: token: handle authorization_code (pt2) (#5589) 2025-04-28 14:37:19 -04:00
Denis Mishin
7b9c392531
mcp: token: handle authorization_code request (pt1) (#5587) 2025-04-28 14:09:22 -04:00