Open sdaberdaku opened 1 month ago
So apparently I missed the important note at this page: https://trino.io/docs/current/security/jwt.html
And I guess I am getting this error because I am using the ID token issued by Google, which is not the actual access token (which is not supported by JWT auth since it is not a Base64 token).
In my use-case I will probably need to use two different Identity Providers, Google Workspace for OAuth2 and a custom built IdP for JWT authentication. Is this setup possible?
yes you can use as many authentication plugins as you want. http-server.authentication.type
is a comma-separated list (see https://trino.io/docs/current/security/authentication-types.html#multiple-authentication-types). The Web UI however only supports one mechanism.
Closing for now since it seems you have the answer, feel free to reopen if needed.
Hey @hashhar, thanks for the response! Would it be possible to configure two OAUTH2 idps at the same time? Say Google Workspace and Keycloak?
not for oauth2, but possible for password and header authenticators (see https://trino.io/docs/current/security/authentication-types.html#multiple-password-authenticators).
For OAuth2 how would engine know which authenticator to invoke for given principal? And the other issue that once the engine has a token and the token for example is being passed-through then how does data sources know which token to use, for example if user exists in both IdPs?
I know in Snowflake for example the admins specify based on patterns where the user is mapped to specific IdP before login.
cc: @dain if he's interested in this concept of federated IdP support. (https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-security-integration-multiple)
For OAuth2 how would engine know which authenticator to invoke for given principal?
I think the user would have to specify the desired IdP with a connection parameter. On the WebUI I imagine the user could be presented with buttons for each IdP to choose the desired one.
Hello all,
I have set up Trino 459 with both JWT and OAUTH2 authentication methods. I want users to authenticate using Google Workspace, and then I want applications to forward their JWT tokens to Trino so that I never use static credentials. Everthing seems to be working fine, except when I perform JWT authentication and get the following error in the coordinator logs:
It looks as if Trino is using the OAuth2 userinfo endpoint to validate the JWT token. By the way the JWT tokens are validated correctly, expired and invalid tokens are rejected while valid ones allow me to run queries. OAuth2 is also working fine, whenever I use that auth mechanism I see no errors. Also, if I disable the OAUTH2 authentication, this error message is not shown.
Here is my coordinator
config.properties
:And this is the Python code I'm using to test the connection: