Skip to content

External Auth Client

polaris.hub.external_client.ExternalAuthClient

ExternalAuthClient(settings: PolarisHubSettings, cache_auth_token: bool = True, **kwargs: dict)

Bases: OAuth2Client

This authentication client is used to obtain OAuth 2 tokens from Polaris's external OAuth2 server. These can in turn be used to obtain Polaris Hub tokens.

Internal use

This class is intended for internal use by the PolarisHubClient class, and you should not have to interact with it directly.

Parameters:

Name Type Description Default
settings PolarisHubSettings

A PolarisHubSettings instance.

required
cache_auth_token bool

Whether to cache the auth token to a file.

True
**kwargs dict

Additional keyword arguments passed to the authlib OAuth2Client constructor.

{}

user_info property

user_info: dict

Get information about the currently logged-in user through the OAuth2 User Info flow.

interactive_login

interactive_login(overwrite: bool = False, auto_open_browser: bool = True)

Login to the Polaris Hub using an interactive flow, through a Web browser.

Headless authentication

It is currently not possible to log in to the Polaris Hub without a browser. See this GitHub issue for more info.

Parameters:

Name Type Description Default
overwrite bool

Whether to overwrite the current token if the user is already logged in.

False
auto_open_browser bool

Whether to automatically open the browser to visit the authorization URL.

True