Hello,
I just started digging into how this works by setting up a little ‘fake’ auth server that captures the data posted by Orthanc, processes the requests, and for now always returns the granted JSON.
{
"granted": true,
"validity" : 0
}
https://book.orthanc-server.com/plugins/authorization.html
I tried integrating it with OE2, and I am getting an error like this for the:
https://localhost:8042/ui/api/configuration route:
|Details|List of strings expected in field: permissions|
|HttpError|Bad Request|
|HttpStatus|400|
|Message|Bad file format|
|Method|GET|
|OrthancError|Bad file format|
|OrthancStatus|15|
|Uri|/ui/api/configuration|
thrown in: E0426 01:25:04.904496 PluginsManager.cpp:153]
The generated config for Authorization is like this:
{
"Authorization": {
"WebServiceRootUrl": "http://nginx/",
"WebService": "http://nginx/",
"WebServiceIdentifier": "change-me",
"TokenHttpHeaders": [
"token"
],
"TokenGetArguments": [
"token",
"auth-token",
"authorization"
],
"StandardConfigurations": [
"osimis-web-viewer",
"stone-webviewer",
"orthanc-explorer-2"
],
"CheckedLevel": "studies",
"Permissions": [
[
"post",
"^/auth/tokens/decode$",
""
],
[
"post",
"^/tools/lookup$",
""
],
[
"post",
"^/tools/find$",
"all|view"
],
[
"get",
"^/(patients|studies|series|instances)/([a-f0-9-]+)$",
"all|view"
],
[
"get",
"^/(patients|studies|series|instances)/([a-f0-9-]+)/(studies|study|series|instances)$",
"all|view"
],
[
"get",
"^/instances/([a-f0-9-]+)/(tags|header)$",
"all|view"
],
[
"get",
"^/statistics$",
"all|view"
],
[
"get",
"^/changes$",
"all|view"
],
[
"put",
"^/auth/tokens/(viewer-instant-link|meddream-instant-link)$",
"all|view"
],
[
"put",
"^/auth/tokens/(download-instant-link)$",
"all|download"
],
[
"put",
"^/auth/tokens/(stone-viewer-publication|meddream-viewer-publication|osimis-viewer-publication|ohif-viewer-publication)$",
"all|share"
],
[
"post",
"^/instances$",
"all|upload"
],
[
"get",
"^/jobs/([a-f0-9-]+)$",
"all|send|modify|anonymize|q-r-remote-modalities"
],
[
"post",
"^/(peers|modalities)/(.*)/store$",
"all|send"
],
[
"get",
"^/(peers|modalities)$",
"all|send|q-r-remote-modalities"
],
[
"post",
"^/modalities/(.*)/echo$",
"all|send|q-r-remote-modalities"
],
[
"post",
"^/modalities/(.*)/query$",
"all|q-r-remote-modalities"
],
[
"get",
"^/queries/([a-f0-9-]+)/answers$",
"all|q-r-remote-modalities"
],
[
"post",
"^/modalities/(.*)/move$",
"all|q-r-remote-modalities"
],
[
"get",
"^/DICOM_WEB_ROOT/servers$",
"all|send|q-r-remote-modalities"
],
[
"get",
"^/DICOM_WEB_ROOT/(servers)/(.*)/stow$",
"all|send"
],
[
"post",
"^/(patients|studies|series|instances)/([a-f0-9-]+)/modify(.*)$",
"all|modify"
],
[
"post",
"^/(patients|studies|series|instances)/([a-f0-9-]+)/anonymize(.*)$",
"all|anonymize"
],
[
"delete",
"^/(patients|studies|series|instances)/([a-f0-9-]+)$",
"all|delete"
],
[
"post",
"^/tools/bulk-delete$",
"all|delete"
],
[
"put",
"^/tools/log-level$",
"all|settings"
],
[
"get",
"^/tools/log-level$",
"all|settings"
]
]
}
}
When I have a blank config:
{
"Authorization" : {}
}
I get this, which I presume is the expected behavior:
W0426 02:02:15.926832 PluginsManager.cpp:261] Registering plugin 'authorization' (version 0.5.1)
W0426 02:02:15.927938 PluginsManager.cpp:157] Initializing the authorization plugin
W0426 02:02:15.933596 PluginsManager.cpp:157] Authorization plugin: no url defined for Token Validation
W0426 02:02:15.934575 PluginsManager.cpp:157] Authorization plugin: no url defined for User Profile
W0426 02:02:15.935509 PluginsManager.cpp:157] Authorization plugin: no base url defined for Token Creation
W0426 02:02:15.936585 PluginsManager.cpp:157] Authorization plugin: ----------- insecure setup ---------- No Token Validation or User Profile url defined -> will only be able to generate tokens. Authentication is not enabled -> anyone will have access to all API routes.