diff --git a/app.py b/app.py index 85a0098..7e09043 100644 --- a/app.py +++ b/app.py @@ -42,12 +42,12 @@ def test_data(): ) client_metadata = { "client_name": "Test client", - "client_uri": "data:text/html;charset=utf-8,client-uri", + "client_uri": "https://social.yandex.net", "grant_types": ['authorization_code', 'refresh_token'], - "redirect_uris": "data:text/html;charset=utf-8,redirect-uri", + "redirect_uris": "https://social.yandex.net/broker/redirect", "response_types": ['code', 'token'], "scope": 'profile', - "token_endpoint_auth_method": 'client_secret_basic' + "token_endpoint_auth_method": 'client_secret_post' } client.set_client_metadata(client_metadata) client.client_secret = gen_salt(48) @@ -63,7 +63,7 @@ if __name__ == '__main__': # http://127.0.0.1:5000/oauth/authorize?scope=profile&response_type=code&client_id=rrC8VDll9RRbBjNLhY4T9jDO -# > curl -u rrC8VDll9RRbBjNLhY4T9jDO:CxKyWG8Z972hkLQq7hMblH7BsP4JWtQn7qahqzW15h5ZUUJI -XPOST "http://127.0.0.1:5000/oauth/token" -F client_id=rrC8VDll9RRbBjNLhY4T9jDO -F client_secret=CxKyWG8Z972hkLQq7hMblH7BsP4JWtQn7qahqzW15h5ZUUJI -F grant_type=authorization_code -F code=wur5zaxmDfxK9Qsvvebqz1N0XKa7zewSrNYJJAYHlZGfsOJa +# > curl -XPOST "http://127.0.0.1:5000/oauth/token" -F client_id=rrC8VDll9RRbBjNLhY4T9jDO -F client_secret=CxKyWG8Z972hkLQq7hMblH7BsP4JWtQn7qahqzW15h5ZUUJI -F grant_type=authorization_code -F code=wur5zaxmDfxK9Qsvvebqz1N0XKa7zewSrNYJJAYHlZGfsOJa # < {"access_token": "LBdvuoKeiY9tHJKMoLdvrG8Zfqs4FbPOz1ze0Ahv96", "expires_in": 864000, "scope": "profile", "token_type": "Bearer"} # > curl -H "Authorization: Bearer LBdvuoKeiY9tHJKMoLdvrG8Zfqs4FbPOz1ze0Ahv96" "http://127.0.0.1:5000/api/me" diff --git a/config.py b/config.py index 08ad30e..6e0a126 100644 --- a/config.py +++ b/config.py @@ -2,6 +2,7 @@ import os app_dir = os.path.abspath(os.path.dirname(__file__)) +os.environ['AUTHLIB_INSECURE_TRANSPORT'] = 'true' class BaseConfig: SECRET_KEY = os.environ.get('SECRET_KEY') or '0d6e368e-bd0c-11ea-921d-9342d47f60ca'