Skip to content

Make RetrieveToken usable by client packages #354

Open
@mholt

Description

@mholt

I'm working on a client that needs to refresh tokens in a special way, so I'm implementing my own TokenSource. The strange thing seems to be that, although the TokenSource interface is exported, I can't actually reuse the provided logic to refresh a token, as retrieveToken is unexported and it calls an internal-only function: internal.RetrieveToken(), even though all the parameters are exported values too.

oauth2/token.go

Line 154 in c453e0c

tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v)

I'd like to use either retrieveToken() or internal.RetrieveToken() as I'm essentially wrapping it differently than the built-in token refresher.

Can we potentially export retrieveToken() or make internal.RetrieveToken() usable by external packages?

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