Wiki source code of Session Authentication Tokens

Last modified by michaely on 2021/09/10 23:34

Show last authors
1 {{layout}}
2 {{layout-section ac:type="two_right_sidebar"}}
3 {{layout-cell}}
4 {{warning}}
5 This page is currently being written. Although the information below is probably accurate, it may not be complete or may have errors.
6 {{/warning}}
7
8 {{info}}
9 The information on this page applies to **iSymphony 3.1+**.
10 {{/info}}
11 {{/layout-cell}}
12
13 {{layout-cell}}
14 {{panel title="On this page:"}}
15
16
17 {{toc maxLevel="2" indent="1"/}}
18 {{/panel}}
19 {{/layout-cell}}
20 {{/layout-section}}
21
22 {{layout-section ac:type="single"}}
23 {{layout-cell}}
24 = Description =
25
26 Session authentication tokens are used to pre-authorize client logins. First, a request is made to the iSymphony REST system which specifies user login credentials. If the credentials are valid a session identifier will be returned. The session identifier can then be used in the URL when accessing the iSymphony client, which will automatically log the user in. This will prevent the user from having to providing the login credentials via the login form.
27
28 For more information on the specifics of the REST request for session authentication tokens, see [[doc:Core Server Configuration]].
29
30 = Token Expiration =
31
32 (% style="color: rgb(0,0,0);" %)Once created a token will be valid for one hour. The REST request for the token will return a time-stamp specifying when the token will expire.
33
34 = (% style="color: rgb(0,0,0);" %)Example(%%) =
35
36 1. (((
37 (% style="color: rgb(0,0,0);" %)Send a REST request, similar to the one below, to iSymphony. Specify the username and password you want to create the session token with.(%%)
38 (% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)
39
40 {{info}}
41 The request below specifies the core server id of "9280cd1c-4ad7-4ed9-ae8a-0648b0b45cf7" to create the session token on. You may need to specify a different core server id for your request.
42 {{/info}}
43
44 {{code language="bash"}}
45 curl --user manager:manag3rpa55word -k -i -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"username":"johnd","password":"pass"}' http://localhost:58080/communication_manager/api/resource/core/9280cd1c-4ad7-4ed9-ae8a-0648b0b45cf7/authToken
46 {{/code}}
47 )))
48 1. (((
49 (% style="color: rgb(0,0,0);" %)If the user login credentials are valid JSON similar to the following will be returned in the response. Take note of the (%%)**sessionIdentifier** value.
50
51 {{code}}
52 {
53 "sessionIdentifier": "1b841f86-8dfe-4e97-9609-8af83888fbfd",
54 "userIdentifier": "ed38fe4d-13ad-4fd0-be25-d3404c421370",
55 "expiry": 1417995590444,
56 "renewExpiry": false
57 }
58 {{/code}}
59
60 (% style="color: rgb(0,0,0);" %)
61 )))
62 1. (((
63 (% style="color: rgb(0,0,0);" %)When logging into the client send the session identifier value with the **sesisonId** HTTP GET variable, like so.
64
65 {{code}}
66 http://<ip or hostname of the iSymphony server>:58080/client/client?sessionId=1b841f86-8dfe-4e97-9609-8af83888fbfd
67 {{/code}}
68
69 (% style="color: rgb(0,0,0);" %)If you have multiple core servers configured you can specify the slug/unique id of core server to login to via the coreServerSlug HTTP GET variable, like so.
70
71 {{code}}
72 http://<ip or hostname of the iSymphony server>:58080/client/client?sessionId=1b841f86-8dfe-4e97-9609-8af83888fbfd&coreServerSlug=<slug or unique of the core server>
73 {{/code}}
74
75 (% style="color: rgb(0,0,0);" %)
76
77 )))
78 {{/layout-cell}}
79 {{/layout-section}}
80 {{/layout}}
iSymphony