-
Notifications
You must be signed in to change notification settings - Fork 760
Implementing SAML based SSO on Opengrok Instance #4723
Replies: 1 comment · 6 replies
-
Firstly, take a look at https://github.com/oracle/opengrok/wiki/Authorization The authentication layer is independent, OpenGrok performs authorization only based on the authentication information passed in the form of HTTP headers or Java object properties. |
Beta Was this translation helpful? Give feedback.
All reactions
-
As for Apache, the reverse proxy configuration looks like this (assuming Tomcat listens on port 8080 and OpenGrok is served on
The
Obviously, you will need to supply the cert/key and CA cert as well as the IdP and SP metadata files. These are specific to your environment. As you can see it extracts username/id from the SAML response and inserts them into HTTP headers. These headers will be processed by OpenGrok authorization stack. Also, there needs to be something which prohibits connections to port 8080 from the outside, e.g. Tomcat configuration or host firewall. Then the relevant part of authorization stack for OpenGrok (stored in read-only configuration) looks like this: <void property="pluginStack">
<!-- The setup will be inherited to all sub-stacks -->
<void property="setup">
<void method="put">
<string>configuration</string>
<string>/opengrok/auth/config/ldap-plugin-config-pdit.yml</string>
</void>
</void>
<void property="stack">
<!-- get user cred from HTTP headers -->
<void method="add">
<object class="org.opengrok.indexer.authorization.AuthorizationPlugin">
<void property="name">
<string>opengrok.auth.plugin.UserPlugin</string>
</void>
<void property="flag">
<string>REQUISITE</string>
</void>
<void property="setup">
<void method="put">
<string>decoder</string>
<string>opengrok.auth.plugin.decoders.MellonHeaderDecoder</string>
</void>
</void>
</object>
</void>
...
<!-- add substacks/plugins here to actually enforce the authorization -->
</void>
</void> |
Beta Was this translation helpful? Give feedback.
All reactions
-
After assessing our use-case, we found that it fits our architecture better to use HAProxy for SSO authentication in the same way that mod_auth_mellon does by forwarding the auth in the HTTP headers since it already is the proxy in front of opengrok. In this case, the configuration on tomcat side remains the same as mentioned above correct? Thank you for your assistance! |
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, as long as OpenGrok receives the HTTP headers carrying the user information. The |
Beta Was this translation helpful? Give feedback.
All reactions
-
Okay that's great. One last thing for now, is there a specific callback endpoint to be configured on the level of the Identity Provider for the SSO to redirect to or the callback is the opengrok URL itself? |
Beta Was this translation helpful? Give feedback.
All reactions
-
The way it works with this kind of SSO is that once the authentication takes place, the SP redirects to the original URL. |
Beta Was this translation helpful? Give feedback.
All reactions
This discussion was converted from issue #4722 on February 11, 2025 12:15.
-
Hello,
Can you please provide steps and an example of how to set up SSO on our opengrok instance? We have an opengrok deployment on a kubernetes cluster that we want to implement SSO authentication on using SAML communicating with Azure AD.
@vladak mentioned that it is something he was able to get working in #3189, and we would like some help implementing something similar.
Your assistance is greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions