Mercurial > hg > orthanc-authorization
annotate README @ 72:e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
author | Alain Mazy <am@osimis.io> |
---|---|
date | Fri, 24 Feb 2023 18:13:36 +0100 |
parents | 6190b564622f |
children | 68ce6fd8b22a |
rev | line source |
---|---|
1 | 1 Advanced authorization for Orthanc |
2 ================================== | |
3 | |
4 | |
5 General Information | |
6 ------------------- | |
7 | |
8 This repository contains the source code of an advanced authorization | |
9 plugin for Orthanc. | |
10 | |
11 For each incoming REST request to some URI, the plugin will query a | |
12 Web service to know whether the access is granted to the | |
13 user. Authorization credentials can be retrieved either from a GET | |
14 argument, or from a HTTP header. | |
15 | |
16 | |
17 Installation and usage | |
18 ---------------------- | |
19 | |
20 Build instructions are similar to that of Orthanc: | |
51 | 21 https://book.orthanc-server.com/faq/compiling.html |
1 | 22 |
23 Usage details are available as part of the Orthanc Book: | |
24 http://book.orthanc-server.com/plugins/authorization.html | |
25 | |
26 | |
72
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
27 API |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
28 --- |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
29 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
30 Since version 0.5.0, the plugin implements a RestA API to generate tokens |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
31 (provided that the Web service is able to do so). |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
32 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
33 Sample Orthanc Flavored API: |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
34 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
35 curl -X PUT http://localhost:8042/auth/tokens/resource-instant-link -H 'Content-Type: application/json' \ |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
36 -d '{"ID": "toto", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
37 "Resources" : [{ |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
38 "DicomUid": "1.2", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
39 "OrthancId": "", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
40 "Level": "study" |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
41 }], |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
42 "Type": "resource-instant-link", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
43 "ExpirationDate": "2026-12-31T11:00:00Z"}' |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
44 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
45 Sample response: |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
46 { |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
47 "Token": "e148.....", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
48 "Url": null |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
49 } |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
50 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
51 The API that must be implemented by the webservice is slighlty different wrt naming conventions: |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
52 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
53 curl -X PUT http://localhost:8000/tokens/resource-instant-link -H 'Content-Type: application/json' \ |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
54 -d '{"id": "toto", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
55 "resources" : [{ |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
56 "dicom-uid": "1.2", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
57 "level": "study" |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
58 }], |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
59 "type": "resource-instant-link", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
60 "expiration-date": "2026-12-31T11:00:00Z"}' |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
61 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
62 Sample response: |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
63 { |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
64 "token": "e148.....", |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
65 "url": null |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
66 } |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
67 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
68 |
e381ba725669
new PUT auth/tokens/{token-type} API route + updated interface with WebService
Alain Mazy <am@osimis.io>
parents:
51
diff
changeset
|
69 |
1 | 70 Licensing |
71 --------- | |
72 | |
73 The authorization plugin for Orthanc is licensed under the AGPL license. | |
74 | |
75 We also kindly ask scientific works and clinical studies that make | |
76 use of Orthanc to cite Orthanc in their associated publications. | |
77 Similarly, we ask open-source and closed-source products that make | |
78 use of Orthanc to warn us about this use. You can cite our work | |
79 using the following BibTeX entry: | |
80 | |
81 @inproceedings{Jodogne:ISBI2013, | |
82 author = {Jodogne, S. and Bernard, C. and Devillers, M. and Lenaerts, E. and Coucke, P.}, | |
83 title = {Orthanc -- {A} Lightweight, {REST}ful {DICOM} Server for Healthcare and Medical Research}, | |
84 booktitle={Biomedical Imaging ({ISBI}), {IEEE} 10th International Symposium on}, | |
85 year={2013}, | |
86 pages={190-193}, | |
87 ISSN={1945-7928}, | |
88 month=apr, | |
89 url={http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=6556444}, | |
90 address={San Francisco, {CA}, {USA}} | |
91 } |