Hi there, anyone please tell me that how can I turn on the user authentication, while building Orthanc from source code, in Visual Studio 2022, I want to open the user login panel, I configured the authentication file which i found in orthanc server, but configuring and building the projet again is not giving me the popup window for login, the authentication is not turning on.
Hi, Usama. I hope this message finds you well.
You can refer to the official documentation for that. Running from source means you’ll want to generta sample config.
From there just read the generated file. There’s comments everywhere (which I personally love). One of them is about authentication.
Most importantly, you’ll want to define your requirements for that feature to understand whether the default suffices or if you’ll want the just as well documented Advanced Authentication plugin.
Hth,
Luiz
PS when sending messages to this list, please refrain from sending multiple emails abou the same topic; there are a great number of people you’re teaching out to, just be mindful of that.
Thank you Luiz, for the response. I think I couldn’t elaborate my question appropriately. Let me describe my question in detail.
We want to debug the user authentication workflow (authenticating users from config file) of Orthanc in Visual Studio by running from source code. here is the following Orthanc source folder structure
→ Build
→ OrthancFramework
→ OrthancServer
→ and other files…
in “OrthancServer/Resources” we have found a “Configuration.json” file in which we have enabled user authentication as described in the following guide (https://book.orthanc-server.com/faq/authentication.html) but after running Orthanc from source via Visual Studio, Orthanc is just running fine in the web browser but not asking for user credentials in the popup login window.
Are we doing it wrong?
Is there any other place from where we have to enable the user authentication in the source code?
How we can enable user authentication in Orthanc for the source code? not for the installed Orthanc instance.
Thank you in anticipation.
Hi Usama,
This configuration file in the source code is just the default configuration file that is used for documentation and to generate a new configuration file with the command line
Orthanc --config=c:\tmp\configuration.json
If you want to enable user auth in Orthanc, simply create a config file like this:
{
“AuthenticationEnabled” : true,
“RegisteredUsers” : {
“alice” : “alicePassword”
}
}
save it in c:\tmp\orthanc.json and pass it as an argument when launching Orthanc:
Orthanc.exe c:\tmp\orthanc.json
HTH
Alain.
Thanks Alain,
You saved the day, I dropped the configuration file in the build folder and then added its path to Orthanc Project Properties>>Debugging>>Command Arguments as $(ProjectDir)Configuration.json after turning on the authentication from it.
Now I can receive the pop-up window for logging the user in.
Regards Usama.