trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.39k stars 2.98k forks source link

Support multiple authentication types for web-ui.authentication.type #15137

Open vishalya opened 1 year ago

vishalya commented 1 year ago

The api server supports mulitple authentication types e.g. The config for the api could be

http-server.authentication.type=oauth2,PASSWORD

But the config for the web-ui can support only one type of the authentication. It should follow the same pattern as api

web-ui.authentication.type=oauth2,form

With the above web-ui config coordinator fails to start with the following error -

1) [Guice/JitDisabled]: Explicit bindings are required and WebUiAuthenticationFilter is not explicitly bound.
  at ResourceSecurityDynamicFeature.<init>(ResourceSecurityDynamicFeature.java:70)
      \_ for 3rd parameter webUiAuthenticationFilter
  at ServerSecurityModule.setup(ServerSecurityModule.java:57)
hashhar commented 1 year ago

cc: @dain

dain commented 1 year ago

The UI only supports a single authentication method. It is possible to support multiple authentication systems, but it would require some changes... it isn't hard but likely a few days worth of work.

Chaho12 commented 2 months ago

Would be great if this multiple web ui authentication is supported!

Chaho12 commented 2 months ago

i notice this simply installs single module in code

would changing it to code below work as simple? https://github.com/trinodb/trino/blob/master/core/trino-main/src/main/java/io/trino/server/security/ServerSecurityModule.java#L56-L95