oauth-2.0

How to connect SQLAlchemy to Snowflake database using OAuth2?

How to connect SQLAlchemy to Snowflake database using OAuth2? Question: I need to connect to Snowflake using SQLAlchemy but the trick is, I need to authenticate using OAuth2. Snowflake documentation only describes connecting using username and password and this cannot be used in the solution I’m building. I can authenticate using Snowflake’s python connector but …

Total answers: 2

How to Establish Python Connection with HANA using OAUTH/JWT

How to Establish Python Connection with HANA using OAUTH/JWT Question: We are currently using basic authentication in our python connectors to SAP HANA. In our current connection string, we use SQLAlchemy and it looks something like this: def get_engine(host_name): return create_engine(‘hana://{user}:{password}@{host_name}:{port}/HUP’.format( user=request.json[‘username’], password=base64.b64decode(bytes(request.json[‘password’], encoding=’utf-8′)).decode(‘utf-8’), host_name=host_name, port=current_app.config[‘HANA_PORT’] ) ) We now need to transition into using …

Total answers: 1

How to create Client Assertion JWT token when connecting to Azure AD?

How to create Client Assertion JWT token when connecting to Azure AD? Question: My issue is that I’m not sure what to use to sign the JWT token to make Client assertion when sending back authorized code to the Azure AD to get access token. The supported auth method is "private_key_jwt". The only thing provided …

Total answers: 2

PyJWT won't import jwt.algorithms (ModuleNotFoundError: No module named 'jwt.algorithms')

PyJWT won't import jwt.algorithms (ModuleNotFoundError: No module named 'jwt.algorithms') Question: For some reason, PyJTW doesn’t seem to work on my virtualenv on Ubuntu 16.04, but it worked fine on my local Windows machine (inside a venv too). I’m clueless, I’ve tried different versions, copied the exact same versions as I had on my Windows machine, …

Total answers: 5

How to decode opaque Access Token with Oauth2.0

How to decode opaque Access Token with Oauth2.0 Question: I have got a token key which contains the logged in person email address as well as the name and other end points.This was actually used in xero API connection. scope = ‘offline_access accounting.reports.read accounting.settings.read openid profile email’ I need to decode this token key and …

Total answers: 2

How to implement OAuth to FastAPI with client ID & Secret

How to implement OAuth to FastAPI with client ID & Secret Question: I have followed the docs about Oauth2 but it does not describe the proccess to add client id and secret https://fastapi.tiangolo.com/advanced/security/oauth2-scopes/ and what this does class UserInDB(User): hashed_password: str from the original example Asked By: mike_sth || Source Answers: In documentation it uses …

Total answers: 2

DRF responses me by 403 error when I try to request as a client [Client Credential grant]

DRF responses me by 403 error when I try to request as a client [Client Credential grant] Question: In settings.py file I have written this settings: REST_FRAMEWORK = { ‘DEFAULT_AUTHENTICATION_CLASSES’: ( ‘oauth2_provider.contrib.rest_framework.OAuth2Authentication’, ), ‘DEFAULT_PERMISSION_CLASSES’: ( ‘rest_framework.permissions.IsAuthenticated’, ), } When I call any API with a token from a password grant application, then It’s working fine, …

Total answers: 3

How to use the Requests OAuthlib with grant-type 'Client Credentials'?

How to use the Requests OAuthlib with grant-type 'Client Credentials'? Question: So I try to call an API which only provides an token url in the docs. For this I want to use the OAuthlib from the python requests package. When I view at their docs they give this example: # Credentials you get from …

Total answers: 2

How to Auth to Google Cloud using Service Account in Python?

How to Auth to Google Cloud using Service Account in Python? Question: I’m trying to make a project that will upload Google Storage JSON file to BigQuery (just automate something that is done manually now), and I’d like to use a ‘service account’ for this as my script is going to be run on daily …

Total answers: 5

How to prevent "ImportError: No module named oauth2client.client" on Google App Engine?

How to prevent "ImportError: No module named oauth2client.client" on Google App Engine? Question: We are receiving an error: ImportError: No module named OAuth2Client We have noticed scores of questions around this topic, many unanswered and at least one answer that describes the solution of copying over files from the Google App Engine SDK. This approach, …

Total answers: 5