Coder Social home page Coder Social logo

streamlit-google-oauth's Introduction

Streamlit app with Google Oauth

This is a simple streamlit app that uses google oauth for user authentication

Follow the steps to properly run the web app

I - Create a Google Cloud Platform project

Create a Google Cloud project by following instructions in the Document here Delete the credentials.json and token.json in the main folder and replace them by your credentials.json and token.json if you have already generated a token

II - Instructions for Google OAuth

1 - Go to the Credentials page in GCP Console 2 - Click on Create Credentials > OAuth client ID 3 - Select Web Application for Application type and fill in the name for your client 4 - Fill in Redirect URIs for your application. These are the links you want the users to be redirected back to after logging in. For example, in local environment, you can use http://localhost:8501/ 5 - Note down the Client ID, Client Secret, Redirect URI for later

6 - Enable Google - People API

7 - Add Client ID, Client Secret and Redirect URI in the .env file following the sample provided

GOOGLE_CLIENT_ID="GOOGLE_CLIENT_ID"
GOOGLE_CLIENT_SECRET="GOOGLE_CLIENT_SECRET"
REDIRECT_URI="http://localhost:8501/"

III - Create a virtual environment and install the requirements

Run pip install -U -r requirements.txt to install the requirements

IV - Run the streamlit web app

Run the streamlit Resume reviewer web app using command streamlit run streamlit_app.py after installing requirements specified in requirements.txt

Example on how to use this library to easily add google auth to your streamlit app in two lines.

import streamlit as st
from google_auth_decorator import google_auth_required


@google_auth_required
def homepage():
    # Home page content goes here...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.