Embracing the Messiness in Search of Epic Solutions

Tag: Python

  • MSAL: Caching Access Token

    Why Cache Access Token with MSAL? Building upon the previous post that performs delegated access authentication with MSAL, suppose your program uses this function to get the access token. In this case, it will always launch the browser to complete the authentication flow and retrieve the access token every time the program runs. While it… Read More…

  • MSAL: Launching Specific Browser with Delegated Access Authentication

    Why Launch a Specific Browser with MSAL? Building upon the previous post that performs delegated access authentication with MSAL, your institution may sometimes allow you to access Microsoft 365 products only on the approved browsers. By default, MSAL launches the default browser on your machine to obtain the access token interactively. If your institution only… Read More…

  • MSAL: Delegated Access Authentication

    The Microsoft Authentication Library (MSAL) supports various programming languages and frameworks to simplify the authentication flow against the Microsoft identity platform, which is a prerequisite to invoke APIs such as Microsoft Graph. In this example, we will write a Python script that performs delegated authentication flow using the user’s credentials. Once authenticated, the script will… Read More…

  • Cloud Run: Connecting to Cloud SQL with Private IP and SSL

    There are various ways for a Cloud Run instance to connect to a Cloud SQL instance. Regardless of the solutions, if both resources reside in the same GCP organization, connecting using a Cloud SQL’s private IP with SSL/TLS encryption is highly recommended to prevent network traffic from going out to the internet. It is possible… Read More…

  • Enabling Python VirtualEnv in JupyterLab

    This post illustrates how you can enable Python virtualenv in GCP JupyterLab so that you can organize your .ipynb files to use different virtual environments to keep track of Python package dependencies. PROBLEM You are using GCP JupyterLab. You want to adhere to the Python development best practices by not polluting the global environment with… Read More…