Version 4.1 by Admin on 2020/01/18 13:45

Hide last authors
Admin 3.1 1
2
Admin 4.1 3 {{id name="_GoBack"/}}
4 SAML is setup on ONECount which can support both IDP and SP initiated logins. The main use of this saml is to provide authentication and authorization services for the SP while ONECount being IDP. We are using OPENSAML API to read the login requests and create SAML responses based on the authentication result. This document uses the following abbreviations.
5 SP (Service Provider) : The system which is having the services the user requests for. The Service provider would just render services based on the authentication information provided by IDP.
6 IDP (Identity Provider) : The system which manages the user details and the user privileges. The IDP would authenticate user and provide necessary information regarding the user to the SP.
7 SAML: Security Assertion Markup Language is an XML-based, open-standard data format for exchanging authentication and authorization data between an identity provider and a service provider. SAML is a product of the OASIS Security Services Technical Committee. This defines the way SP and IDP communication protocols and how to react to requests.
8 **SSO SERVICES:** In our ONECount we primarily use SAML for SSO Services across all the domains. The SSO services can be broadly divided into 2 types they are
Admin 3.1 9
10 * SP Initiated login
11 * IDP Initiated Login
12
13 **SP Initiated login:** In this type of login the service provider requests for authentication to the IDP on for the same site. In our setup the example for this is harbourside MEDED website login. In SP initiated login the SP needs to create SAML request and send into to ONECount. The onecount then authenticates the user and sends the required details to the SP back as SAML response.
Admin 4.1 14 **IDP Initiated login:** In this type of login the request for authentication would be by made by a partner site or third party site other than SP. In our setup the example is for ethos where the harbourside acts as partner site and has link to ethos websites where we authenticate the user and send required information to SP which is ETHOS in this context. In this type login is initiated by IDP to the SP.
15 **DataBase models:** we have 2 tables in onecount_super data base as these configurations are common for all the clients. WE populate these tables based on the saml meta data file of service provider and other configurations. The table names are
Admin 3.1 16
17 {{id name="OLE_LINK2"/}}
18
19 {{id name="OLE_LINK3"/}} onecount_saml_metadata and
20
21 {{id name="OLE_LINK4"/}}
22
23 {{id name="OLE_LINK5"/}}
24
25 {{id name="OLE_LINK6"/}} onecount_saml_relaystate_mapping and their structure is as follows.
Admin 4.1 26 onecount_saml_metadata
Admin 3.1 27
Admin 4.1 28 (% class="wrapped" %)
Admin 3.1 29 |=(((
30 **Column**
31 )))|=(((
32 **Type**
33 )))|=(((
34 **Comments**
35 )))
36 |(((
37 entity_id
38 )))|(((
39 varchar(400)
40 )))|(((
Admin 4.1 41 (% class="content-wrapper" %)
42 (((
Admin 3.1 43
44
45 {{id name="OLE_LINK1"/}}The entity id of SP which we get in SAML Metadata file.
46 )))
Admin 4.1 47 )))
Admin 3.1 48 |(((
49 soap_binding
50 )))|(((
51 text
52 )))|(((
53 The SOAP binding of SP which we get in SAML Metadata file.
54 )))
55 |(((
56 redirect_binding
57 )))|(((
58 text
59 )))|(((
60 The redirect binding of SP which we get in SAML Metadata file.
61 )))
62 |(((
63 certificate_encryption
64 )))|(((
65 text
66 )))|(((
67 The certificate encryption key of SP which we get in SAML Metadata file.
68 )))
69 |(((
70 certificate_signature
71 )))|(((
72 text
73 )))|(((
74 The certificate signature key of SP which we get in SAML Metadata file.
75 )))
76 |(((
77 logout_post_binding
78 )))|(((
79 text
80 )))|(((
81 The logout post binding of SP which we get in SAML Metadata file.
82 )))
83 |(((
84 logout_redirect_binding
85 )))|(((
86 text
87 )))|(((
88 The logout redirect binding of SP which we get in SAML Metadata file.
89 )))
90 |(((
91 post_binding
92 )))|(((
93 text
94 )))|(((
95 The post binding of SP which we get in SAML Metadata file.
96 )))
97 |(((
98 expiry
99 )))|(((
100 date
101 )))|(((
102 The expiry date of metadata of SP which we get in SAML Metadata file.
103 )))
104 |(((
105 xml_dump
106 )))|(((
107 longtext
108 )))|(((
109 The whole xml metadata as string.
110 )))
111 |(((
112 saml_id
113 )))|(((
114 int(11)
115 )))|(((
116 Unique primary for this table
117 )))
118 |(((
119 fields
120 )))|(((
121 varchar(400)
122 )))|(((
123 JSON format string of demographic fields of user the SP needs with onecount question ID as key and name the SP wants for this particular question.
124 Sample : {1:Email,226:Prefix,4:First name,218:Middle name,5:Last name,12:Postal code,98:Degree,234:Profession,242:Specialty,ocid:OCID}
125 )))
126 |(((
127 client_auth
128 )))|(((
129 varchar(400)
130 )))|(((
131 Client login URL to login page to which we send user for challenge questions when cookies are not found.
132 )))
133 |(((
134 appkey
135 )))|(((
136 varchar(200)
137 )))|(((
138 The app key for the client which we use to make requests to ONECount API.
139 )))
140 |(((
141 brand_info
142 )))|(((
143 varchar(40)
144 )))|(((
145 The brand information required for styling the login/lookup page.
146 )))
147
148
Admin 4.1 149 onecount_saml_relaystate_mapping
Admin 3.1 150
Admin 4.1 151 (% class="wrapped" %)
Admin 3.1 152 |=(((
153 **Column**
154 )))|=(((
155 **Type**
156 )))|=(((
157 **Comments**
158 )))
159 |(((
160 saml_relaystate_id
161 )))|(((
162 int(11)
163 )))|(((
164 Unique primary key for this table
165 )))
166 |(((
167 saml_id
168 )))|(((
169 int(11)
170 )))|(((
171 Foreign key from onecount_saml_mapping table
172 )))
173 |(((
174 relaystate
175 )))|(((
176 varchar(400)
177 )))|(((
178 Relay state pattern or SP website address sample education.annenberg.net
179 )))
180 |(((
181 client_id
182 )))|(((
183 int(11)
184 )))|(((
185 Client id of our client
186 )))
187
188
189 \\\\\\\\\\\\\\\\\\\\When ever we need a new client to use the saml when we configure these parameters from the metadata file and the conf paramaters they provide they should be good.
190 **Login Mechanism :** The total login process can be divided into 3 parts
191
192 * Login Request
193 * Authentication
194 * Login Response
195
196 Login Request: The login request needs to be a valid saml request.
Admin 4.1 197 SP intitiated login: In the case of the SP initiated login ONECount supports Post request with the request payload. We read the request by opensaml java api and extract the required parameters for authentication.
198 IDP Initiated login: In the case of IDP initiated login the partner site needs to have the relay state which is the url of the SP that they want to user to access. They also need to add a query parameter clientid which is used by the onecount to correctly identify the client- SP pair.
199 Login Mechanism:
Admin 3.1 200 The SAML Server relies on cookies for user identification. When the saml receives the login request that looks up the configuration form the database based on entity ID if its SP initiated or relay state and clientid. Then that checks for OCGT cookie. If the cookie is found then that searches the onecount_super database for the ocid of the user form OC_CLIENTS_TOKENS table based on the client id and ocgt value. If an entry is found that means that we are able to identify the user based on the oc_gt cookie.
Admin 4.1 201 If the cookie is not found or the user could not be identified based on oc_gt and clientid then the server is unable to accurately identify the user then the saml redirects the user to login/lookup page for further authentication.while redirectiong the user the whole url of partner site is URLENCODED and sent as return parameter to login/lookup page. When the user authenticates himself the login server sets the updated cookie for the user which is taken and searched in the database.
Admin 3.1 202 When the user is found the server makes a call to ONECount API to retrieve the user information. Once the user information is acquired the saml request is generated.
Admin 4.1 203 SAML Response:
204 The response is generated based on the configuration files using opensaml API. If that is SP initiated login then we have the extra parameter "InResponseTo" in the response which will have the unique request identifier which is used by the service provider to determine their internal state. In the request if the server receives any relay state then SAML server retains that and forwards the relay state without any modification. If it is IDP initiated login then the server will have the SP requested url as the relay state. In our setup we are using URL post binding to send the response to the SP.