Goolge API Request: Authorization Error 400: invalid_request

Summary

Hi everyone. I am trying to connect Streamlight with google signing. I have already done with it, but at the end, it shows the Authentication error like Authorization Error 400: invalid_request

Here my all codes

app.py

import streamlit as st
import os
from dotenv import load_dotenv
import streamlit_google_oauth as oauth

load_dotenv()
client_id = os.environ.get('954732738420-1motd7ifsofncroccmps12ms6la6luq7.apps.googleusercontent.com')
client_secret = os.environ.get('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')
redirect_uri = os.environ.get("https://www.{{http://localhost:8501}}/google/endpoint")
redirect_uri = os.environ.get("http://localhost:8501/redirect")


if __name__ == "__main__":
    login_info = oauth.login(
        client_id=client_id,
        client_secret=client_secret,
        redirect_uri=redirect_uri,
        login_button_text="Continue with Google",
        logout_button_text="Logout",
    )
    if login_info:
        user_id, user_email = login_info
        st.write(f"Welcome {user_email}")
    else:
        st.write("Please login")

setup.py

from setuptools import setup

from streamlit_google_oauth import *

setup(
    name="streamlit_google_oauth",
    version="image.png",
    url="https://github.com/hunkim/streamlit-google-oauth",
    author="Sung Kim",
    author_email="hunkim@gmail.com",
    py_modules=["streamlit_google_oauth"],
    packages=["streamlit_google_oauth"],
    install_requires=[
        "protobuf<=3.20.x",
        "streamlit",
        "httpx-oauth",
        "typing-extensions",
    ],
)

requirments.txt

git+https://github.com/hunkim/streamlit-google-oauth
protobuf<=3.20.x 
streamlit==0.81.1
httpx-oauth==0.3.5
python-dotenv
typing_extensions

Error Message:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.