appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
32.29k stars 3.5k forks source link

[Bug]: Google SSO Token not refreshing #23422

Open felix-appsmith opened 1 year ago

felix-appsmith commented 1 year ago

Is there an existing issue for this?

Description

When logging into Appsmith using Google SSO, one can retrieve the token with <>. However, after one hour, the token expires and is not refreshed.

Steps To Reproduce

  1. Enable Google SSO in your Appsmith application.

  2. Enable the Google People API.

  3. Create a Python server that receives the Google token sent by Appsmith and makes a request to the Google People API.

    
    from flask import Flask, redirect, request
    import requests
    from google.oauth2 import id_token
    from google.auth.transport import requests as google_requests

app = Flask(name)

@app.route('/test', methods=['POST']) def callback(): token = request.json['token']

Use the access token to make a request to the People API

people_api_endpoint = 'https://people.googleapis.com/v1/people/me?personFields=emailAddresses'
print('Token: ', token)
headers = {'Authorization': f'Bearer {token}'}
response = requests.get(people_api_endpoint, headers=headers)
contacts = response.json()

# Process the response as needed
# ...

return contacts

if name == 'main': app.run()

4. Install the dependencies for the Python script.
    ```bash
    pip install flask google-auth requests
  1. Run ngrok on port 5000.
    ngrok http 5000
  2. Log in to Appsmith using Google SSO and configure a new REST API.
  3. In the request body, write the following:

Run it, and you will see a response. Wait for 1 hour, and it will fail due to the expired token.

Public Sample App

No response

Environment

Production

Issue video log

No response

Version

Self-Hosted 1.9.19

geekyme-fsmk commented 3 months ago

@Nikhil-Nandagopal is this released?

Nikhil-Nandagopal commented 3 months ago

@geekyme-fsmk no my mistake, this was accidentally closed.