sundar68 opened a new issue, #30385:
URL: https://github.com/apache/superset/issues/30385

   ### Bug description
   
   Superset is working fine when try to use sdk, while fetching accesstoken 
it's throwing 500 error.
   API: `/api/v1/security/login` 
   payload:
   ```
   password: "****"
   provider: "db"
   refresh: true
   username: "****"
   ```
   Response: {"message":"Fatal error"}
   
   Tried giving Gamma & public user credentials and Admin user credentials, but 
same error. 
   When I tried to hit from swagger getting "Not Authorized error"
   
   ```
    async function fetchAccessToken() {
           try {
             const body = {
               username: "pod1",
               password: "vymo2013",
               provider: "db",
               refresh: true,
             }
         
             const response = await fetch(
               "http://localhost:8088/api/v1/security/login";,
               {
                 method: "POST",
                 body: JSON.stringify(body),
                 headers: {
                   "Content-Type": "application/json",
                 },
               }
             )
         
             const jsonResponse = await response.json()
             return jsonResponse?.access_token
           } catch (e) {
             console.error("error")
           }
         }
     ```
   
   
   
   
   This is my superset_config.py file
   ```
   #custom
   import sys
   sys.path.insert(0, '/app/superset/')
   from custom_security import CustomSecurityManager
   
   ROW_LIMIT = 50000
   SECRET_KEY = '*****'
   SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:***:5432/superset'
   # Flask-WTF flag for CSRF
   WTF_CSRF_ENABLED = False
   # Add endpoints that need to be exempt from CSRF protection
   WTF_CSRF_EXEMPT_LIST = []
   # A CSRF token that expires in 1 year
   WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365
   # Set this API key to enable Mapbox visualizations
   MAPBOX_API_KEY = ''
   
   SUPERSET_WEBSERVER_TIMEOUT = 3000
   
   #SQLLAB
   SQLLAB_ASYNC_TIME_SEC=3600*6
   SQLLAB_TIMEOUT=3600
   SQLALCHEMY_POOL_SIZE = 45
   SQLALCHEMY_MAX_OVERFLOW = 30
   SQLALCHEMY_POOL_TIMEOUT = 180
   
   
   FEATURE_FLAGS = {'DRILL_BY': True,
                    'DASHBOARD_CROSS_FILTERS': True,
                    "EMBEDDABLE_CHARTS": True,
                    "EMBEDDED_SUPERSET": True,
                    "DASHBOARD_NATIVE_FILTERS": True,
                    "DRILL_TO_DETAIL": True,
                    "ENABLE_TEMPLATE_PROCESSING": True,
                    "HORIZONTAL_FILTER_BAR": True,
                    "DASHBOARD_RBAC": True,
                    "DASHBOARD_VIRTUALIZATION": True,
                    "ALERT_REPORTS_NOTIFICATION_DRY_RUN": True,
                    "ALERT_REPORTS": True,
                    "TAGGING_SYSTEM": True,
                    }
   
   
   #API
   FAB_API_SWAGGER_UI = True
   FAB_ADD_SECURITY_API = True
   
   APP_NAME = "Vymo Superset"
   LANGUAGES = {
       'en': {'flag': 'us', 'name': 'English'},
       "ja": {"flag": "jp", "name": "Japanese"},
   }
   JINJA_CONTEXT_ADDONS = {
       'my_crazy_macro': lambda x: x * 2,
   }
   
   #Embed
   PUBLIC_ROLE_LIKE_GAMMA = True
   GUEST_ROLE_NAME = "Gamma"
   TALISMAN_ENABLED = False
   
   #CORS
   SESSION_COOKIE_HTTPONLY = False
   SESSION_COOKIE_SECURE = False
   ENABLE_PROXY_FIX = True
   OVERRIDE_HTTP_HEADERS = {'X-Frame-Options': 'ALLOWALL'}
   ENABLE_CORS = True
   CORS_OPTIONS = {
       'supports_credentials': True,
       'allow_headers': ['*'],
       'resources': ['*'],
       'origins': ['*']
   }
   
   CUSTOM_SECURITY_MANAGER = CustomSecurityManager
   
   
   ```
   
   ### How to reproduce the bug
   
   Try to hit above mentioned api with above config file.
   
   ### Screenshots/recordings
   
   <img width="564" alt="Screenshot 2024-09-25 at 4 08 51 PM" 
src="https://github.com/user-attachments/assets/535296fa-c1b7-47df-9168-65a573ff6cf5";>
   <img width="1162" alt="Screenshot 2024-09-25 at 4 08 31 PM" 
src="https://github.com/user-attachments/assets/54fd7413-6061-4efb-841e-1890a4a16670";>
   
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to