o
    з6i                     @   s   d Z ddlZddlZddlZddlZddlZdZdZe	 ej
ddddd	ej
d
dddddej
dddddddej
dddejeeedddd Zedkr[e  dS dS )a
  Command-line tool for obtaining authorization and credentials from a user.

This tool uses the OAuth 2.0 Authorization Code grant as described in
`section 1.3.1 of RFC6749`_ and implemeted by
:class:`google_auth_oauthlib.flow.Flow`.

This tool is intended for assist developers in obtaining credentials
for testing applications where it may not be possible or easy to run a
complete OAuth 2.0 authorization flow, especially in the case of code
samples or embedded devices without input / display capabilities.

This is not intended for production use where a combination of
companion and on-device applications should complete the OAuth 2.0
authorization flow to get authorization from the users.

.. _section 1.3.1 of RFC6749: https://tools.ietf.org/html/rfc6749#section-1.3.1
    Nzgoogle-oauthlib-toolzcredentials.jsonz--client-secretsz<client_secret_json_file>Tz'Path to OAuth2 client secret JSON file.)metavarrequiredhelpz--scopez<oauth2 scope>z#API scopes to authorize access for.)multipler   r   r   z--savez<save_mode>FzSave the credentials to file.)is_flagr   show_defaultdefaultr   z--credentialsz<oauth2_credentials>z!Path to store OAuth2 credentials.)r   r   r   r   c           	      C   s   t jjj| |d}| }|j|j|j|j|j	|j
d}|rX|d= tj|}|r4tj|s4t| t|d}t|| W d   n1 sJw   Y  td|  dS tt| dS )a)  Command-line tool for obtaining authorization and credentials from a user.

    This tool uses the OAuth 2.0 Authorization Code grant as described
    in section 1.3.1 of RFC6749:
    https://tools.ietf.org/html/rfc6749#section-1.3.1

    This tool is intended for assist developers in obtaining credentials
    for testing applications or samples.

    This is not intended for production use where a combination of
    companion and on-device applications should complete the OAuth 2.0
    authorization flow to get authorization from the users.

    )scopes)tokenrefresh_token	token_uri	client_idclient_secretr	   r
   wNzcredentials saved: %s)google_auth_oauthlibflowInstalledAppFlowfrom_client_secrets_filerun_local_serverr
   r   r   r   r   r	   ospathdirnameisdirmakedirsopenjsondumpclickechodumps)	client_secretsscopesavecredentialsr   creds
creds_dataconfig_pathoutfile r(   g/var/www/hoanhtaovolam_webdjango/env/lib/python3.10/site-packages/google_auth_oauthlib/tool/__main__.pymain.   s*   -	
r*   __main__)__doc__r   r   os.pathr   google_auth_oauthlib.flowr   APP_NAMEDEFAULT_CREDENTIALS_FILENAMEcommandoptionr   joinget_app_dirr*   __name__r(   r(   r(   r)   <module>   sR   /
