Can we change the default algorithm of superset from HS256 to RS256? #29785
Replies: 1 comment 5 replies
-
To change the default algorithm of Superset from HS256 to RS256 and resolve the internal server error related to the PEM not loading when integrating with AWS Cognito, you need to update the Here is the updated configuration: {
"port": 8080,
"logLevel": "info",
"logToFile": false,
"logFilename": "app.log",
"statsd": {
"host": "127.0.0.1",
"port": 8125,
"globalTags": []
},
"redis": {
"port": 6379,
"host": "127.0.0.1",
"password": "",
"db": 0,
"ssl": false
},
"redisStreamPrefix": "async-events-",
"jwtAlgorithms": ["RS256"],
"jwtSecret": "-----BEGIN PUBLIC KEY-----\nYOUR-PEM-KEY-HERE\n-----END PUBLIC KEY-----",
"jwtCookieName": "async-token"
} Make sure to replace Additionally, ensure that you have set the DATABASE_OAUTH2_JWT_ALGORITHM = "RS256" This ensures that the JWT algorithm used for authentication is correctly configured across the necessary components [2]. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
I have successfully integrated Superset with AWS Cognito and I'm able to sign in the users that were created in Cognito. Now, I'm trying to generate a guest token for that user through Superset's API endpoint for guest tokens.
I use the access token generated by Cognito for that user and pass it in the header of the request to generate a guest token. However, I was encountering an "algo not allowed" error since Cognito tokens are encrypted using
RS256
tokens and Superset only acceptsHS256
.To resolve this, I added the following line in the
superset_config.py
script:JWT_DECODE_ALGORITHM=["RS256"]
This resolved the algorithm error, but now I’m getting an internal server error. When I checked the Docker logs, it mentioned that PEM is not loading so I extracted the public key of Cognito and assigned it:
JWT_PUBLIC_KEY= os.getenv("PUBLIC_KEY")
I am still facing the same error. Has anyone encountered this issue before or have any suggestions on how to resolve it? Any help would be greatly appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions