AuthManager¶
- class geodesic.oauth.AuthManager(credentials_path=None)[source]¶
Bases:
object
- get_authorization_url(code_challenge, redirect_uri=None)[source]¶
Returns a URL to generate an auth code. :param code_challenge: The OAuth2 code challenge
- property id_token¶
Requests/returns the access token. If the current token hasn’t expired, returns token
- property access_token¶
Requests/returns the access token. If the current token hasn’t expired, returns token
- authenticate(cli_authorization_code=None, quiet=False, cli_code_verifier=None, port=None)[source]¶
Prompts the user to authorize access to Geodesic via OAuth2.
- Parameters
cli_authorization_code – An optional authorization code. Supports CLI mode, where the code is passed as an argument to geodesic authenticate.
quiet – If true, do not require interactive prompts.
cli_code_verifier – PKCE verifier to prevent auth code stealing. Must be provided if cli_authorization_code is given.
port (Optional[int]) – An optional open port. If provided, authentication will attempt to use an http server to automatically get the authorization code, removing the need to copy-paste. Please note that not all ports may be enabled in your OAuth provider’s list of allowed callback URLs.