Documentation added
[music.git] / docs / authentication.rst
1  `For Single install:`_
2
3  `Multi-Site Install:`_
4
5  `Headers:`_
6
7  `AAF Authentication`_
8
9  `AID Authentication Non-AAF`_
10
11 `Onboarding API`_
12
13 `Add Application`_
14
15 `Get Application`_
16
17 `Edit Application`_
18
19 `Delete Application`_
20
21
22 Steps to test AAF MUSIC has been enhanced to support applications which are already authenticated using AAF and applications which are not authenticated using AAF.
23
24 If an application has already been using AAF, it should have required namespace, userId and password.
25
26 **Non AAF applications (AID)** Works just like AAF but Namespace is an app name and MUSIC manages the User instead of AAF
27
28 All the required params should be sent as headers.
29
30 Changed in Cassandra: Admin needs to create the following keyspace and table.
31
32 In the cassandra bin dir run ./cqlsh and log in to db then:
33
34 If you want to save the following in a file you can then run ./cqlsh -f <file.cql>
35
36 For Single install:
37 ^^^^^^^^^^^^^^^^^^^
38 ::
39
40   //Create Admin Keyspace
41    
42   CREATE KEYSPACE admin
43     WITH REPLICATION = {
44       'class' : 'SimpleStrategy',
45       'replication_factor': 1
46     } 
47   AND DURABLE_WRITES = true;
48  
49     CREATE TABLE admin.keyspace_master (
50      uuid uuid,
51      keyspace_name text,
52      application_name text,
53      is_api boolean,
54      password text,
55      username text,
56      is_aaf boolean,
57      PRIMARY KEY (uuid)
58     );
59
60
61 Multi-Site Install:
62 ^^^^^^^^^^^^^^^^^^^
63
64 ::
65
66   //Create Admin Keyspace
67  
68   CREATE KEYSPACE admin
69   WITH REPLICATION = {
70     'class' : 'NetworkTopologyStrategy',
71     'DC1':2
72   }
73   AND DURABLE_WRITES = true;
74  
75   CREATE TABLE admin.keyspace_master (
76    uuid uuid,
77    keyspace_name text,
78    application_name text,
79    is_api boolean,
80    password text,
81    username text,
82    is_aaf boolean,
83    PRIMARY KEY (uuid)
84  );
85
86 Headers:
87 ^^^^^^^^
88
89 For AAF applications all the 3 headers ns, userId and password are mandatory.
90
91 For Non AAF applications if aid is not provided MUSIC creates new random unique UUID and returns to caller.
92
93 Caller application then need to save the UUID and need to pass the UUID to further modify/access the keyspace.
94
95 Required Headers
96
97 AAF Authentication
98 ^^^^^^^^^^^^^^^^^^
99 ::
100
101   Key     : Value        : Description 
102   ns      : org.onap.aaf : AAF Namespace
103   userId  : username     : USer Id
104   password: password     : Password of User
105
106 AID Authentication Non-AAF
107 ^^^^^^^^^^^^^^^^^^^^^^^^^^
108
109 ::
110
111   Key     : Value        : Description 
112   ns      : App Name     : App Name
113   userId  : username     : Username for this user (Required during Create keyspace Only)
114   password: password     : Password for this user (Required during Create keyspace Only)
115
116 Onboarding API
117 ^^^^^^^^^^^^^^
118
119 Add Application
120 ^^^^^^^^^^^^^^^
121
122 ::
123
124   POST URL: /MUSIC/rest/v2/admin/onboardAppWithMusic  with JSON as follows:
125
126   {
127    "appname": "<the Namespace for aaf or the Identifier for the specific app using AID access",
128    "userId" : "<userid>",
129    "isAAF"  : true/false,
130    "password" : ""
131  }
132   
133 Get Application
134 ^^^^^^^^^^^^^^^
135
136 ::
137
138   POST URL: /MUSIC/rest/v2/admin/search  with JSON as follows:
139
140   {
141    "appname": "<the Namespace for aaf or the Identifier for the specific app using AID access",
142    "isAAF"  : true/false,
143    "aid" : "Unique ID for this user"
144   }
145   
146 Edit Application
147 ^^^^^^^^^^^^^^^^
148
149 ::
150
151   PUT URL: /MUSIC/rest/v2/admin/onboardAppWithMusic  with JSON as follows: 
152
153   {
154   "aid" : "Unique ID for this user",
155   "appname": "<the Namespace for aaf or the Identifier for the specific app using AID access",
156   "userId" : "<userid>",
157   "isAAF"  : true/false,
158   "password" : ""
159   }
160   
161 Delete Application
162 ^^^^^^^^^^^^^^^^^^
163
164 ::
165
166   DELETE URL: /MUSIC/rest/v2/admin/onboardAppWithMusic  with JSON as follows:
167
168  {
169  "aid" : "Unique ID for this app"
170  }