Skip to content

Add support for OAuth clients #1140

@williamjacksn

Description

@williamjacksn

Are you interested in adding support for using OAuth clients to authenticate? Regular API keys expire after at most 90 days, but OAuth client secrets never expire. This is helpful when setting up automation scripts where you don't want to have to update the key periodically.

I think this would not be too difficult:

  • Add class variables for oauth_client_id and oauth_client_secret to the Tailscale class
  • Add method to call https://api.tailscale.com/api/v2/oauth/token and save the token as the api_key on the class
  • Change the _request() method to send the header Authorization: Bearer [...] instead of basic auth

The API documentation suggests you can use Authorization: Bearer [...] with a normal API key as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleThere has not been activity on this issue or PR for quite some time.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions