Skip to content

Access access token from outside auth package #317

@ayumitamai97

Description

@ayumitamai97

Is your feature request related to a problem? Please describe.

After authorization is completed, the access token is added to the current context, but it's not accessible from outside the auth package.
It is causing a problem when an MCP tool requires the access token to get the currently logged in user's information.

Describe the solution you'd like

  1. Export tokenInfoKey so that an MCP tool can retrieve the token so that it can be used from outside the package.
  2. Add AccessToken field to TokenInfo struct.

Describe alternatives you've considered

Defining access_token as MCP parameter. However this doesn't work because MCP clients does not always append access_token to the MCP tool call as parameter.

Additional context

I'm trying out the auth package with the version v0.2.1-0.20250812214950-6e03217c831b.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions