User.php
User service file
- Author
- Dave Cutler
- Copyright
- 2011 SOS Staffing Inc.
- Package
- Service
- Subpackage
- User
\Service_User
User Service
Interacts with a JOSSO back-end for authorizing/deauthorizing user accounts as well as providing information about user accounts in general. Includes staff-specific methods for accessing and updating internal information.
Note: All parameters are required unless otherwise stated.
- Api
- Author
- Dave Cutler
- Copyright
- 2011 SOS Staffing Inc.
Method List
Methods
getMetaData
Returns meta data about the specified user
- Link: https://webservices.sosstaffing.com/user/getMetaData?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- user_id
- (Optional) The user ID to look up, restricted to staff only
- meta_key
- (Optional) A known key to filter for
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <user_id>[user_id]</user_id> <meta_key>[meta_key]</meta_key> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <token>[token]</token> <params> <user_id>[user_id]</user_id> <meta_key>[meta_key]</meta_key> </params> </responseHeader> <response> <meta_data> <key>[value]</key> <key>...</key> </meta_data> </response> </result>
getPassHash
Returns a JOSSO-hashed form of the provided password
- Link: https://webservices.sosstaffing.com/user/getPassHash
-
Parameters:
- password
- The string to hash
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <password>[password]</password> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <params> <password>[password]</password> </params> </responseHeader> <response> <pass_hash>[md5_string]</pass_hash> </response> </result>
getRoles
Returns all roles currently assigned to the session's user
- Link: https://webservices.sosstaffing.com/user/getRoles?token=[token]
-
Parameters:
- token
- A JOSSO session ID
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <token>[token]</token> </responseHeader> <response> <roles> <role>[role]</role> <role>...</role> </roles> </response> </result>
getSSLKeys
Attempt to get keys from database, if not present, generate new keys, store in database, and then return the new keys
- Link: https://webservices.sosstaffing.com/user/validateSession?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- username
- (Optional) Expected username in session
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <userId>[userId]</userId> <passhash>[passhash]</passhash> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <token>[token]</token> <params> <username>[username]</username> </params> </responseHeader> <response> <message>Session token refers to a valid session</message> <keys> <private>[private]</private> <public>[public]</public> </keys> </response> </result>
getSsoData
Returns SSO app data for the current user
- Link: https://webservices.sosstaffing.com/user/getSsoData?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- role
- (Optional) Narrow results by a JOSSO role
- key
- (Optional) Narrow results by a key name
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <role>[role]</role> <key>[key]</key> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <params> <role>[role]</role> <key>[key]</key> </params> </responseHeader> <response> <key>[value]</key> <key>...</key> </response> </result>
getSsoMetaData
Get user-specific meta data from SSO
- Link: https://webservices.sosstaffing.com/user/getSsoMetaData?token=[token]
-
Parameters:
- token
- A JOSSO session ID
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> </responseHeader> <response> <user_lrn>[user_lrn]</user_lrn> <title>[title]</title> <full_name>[full_name]</full_name> <first_name>[first_name]</first_name> <last_name>[last_name]</last_name> <default_branch>[default_branch]</default_branch> <departments> <department>[department]</department> <department>...</department> </departments </response> </result>
getWebData
Returns all user properties currently assigned to the session's user in the web database
- Link: https://webservices.sosstaffing.com/user/getWebData?token=[token]
-
Parameters:
- token
- A JOSSO session ID
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <token>[token]</token> </responseHeader> <response> <user-details> ... </user-details> </response> </result>
hasRole
Verifies that the session's user has a specific role
- Link: https://webservices.sosstaffing.com/user/hasRole?token=[token]
-
Parameters:
- role
- The role to check
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <role>[role]</role> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <token>[token]</token> <params> <role>[role]</role> </params> </responseHeader> <response> <message>User has role</message> </response> </result>
login
Logs in a user and returns basic information about the user and their session
- Link: https://webservices.sosstaffing.com/user/login
-
Parameters:
- username
- Username to access
- password
- Password
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <username>[username]</username> <password>[password]</password> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <params> <username>[username]</username> <password>[password]</password> </params> </responseHeader> <response> <message>User authenticated, session started successfully</message> <session_id>[token]</session_id> <user_data> <name>[user_name]</name> <person_id>[person_id]</person_id> <full_name>[full_name]</full_name> <first_name>[first_name]</first_name> <last_name>[last_name]</last_name> <email_address>[email_address']</email_address> <roles> <role>[role]</role> <role>...</role> </roles> </user_data> <session_data> <accessCount>##</accessCount> <creationTime>##</creationTime> <id>[token]</id> <lastAccessTime>##</lastAccessTime> <maxInactiveInterval>##</maxInactiveInterval> <username>[username]</username> <valid></valid> </session_data> </response> </result>
logout
Logs out the current user
- Link: https://webservices.sosstaffing.com/user/logout?token=
-
Parameters:
- token
- A JOSSO session ID
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> </responseHeader> <response> <message>Logout successful</message> </response> </result>
ping
Verifies the JOSSO service is running
- Link: https://webservices.sosstaffing.com/user/ping
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> </responseHeader> <response> <message>SSO responded successfully</message> </response> </result>
searchByUsername
Finds a user by their username
- Link: https://webservices.sosstaffing.com/user/searchByUsername
-
Parameters:
- username
- The username to find
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <username>[username]</username> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <token>[token]</token> <params> <username>[username]</username> </params> </responseHeader> <response> <user_data> <name>[name]</name> <person_id>[person_id]</person_id> <full_name>[full_name]</full_name> <first_name>[first_name]</first_name> <last_name>[last_name]</last_name> <email_address>[email_address]</email_address> </user_data> </response> </result>
setMetaData
Sets meta data about the specified user
- Link: https://webservices.sosstaffing.com/user/setMetaData?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- user_id
- (Optional) The user ID being added/updated, restricted to staff only
- meta_key
- The key to set
- value
- The value for the key
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <user_id>[user_id]</user_id> <meta_key>[meta_key]</meta_key> <value>[value]</value> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>[##]</requestTimeMs> <token>[token]</token> <params> <user_id>[user_id]</user_id> <meta_key>[meta_key]</meta_key> <value>[value]</value> </params> </responseHeader> <response> <message>Meta data updated successfully</meta_data> </response> </result>
setSsoData
Set SSO app data
- Link: https://webservices.sosstaffing.com/user/setSsoData?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- role
- A JOSSO role
- key
- Key name
- value
- Value to set
- person_id
- (Optional) Person ID being updated
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <role>[role]</role> <key>[key]</key> <value>[value]</value> <person_id>[person_id]</person_id> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <params> <role>[role]</role> <key>[key]</key> <value>[value]</value> <person_id>[person_id]</person_id> </params> </responseHeader> <response> <message>SSO data updated successfully</message> </response> </result>
validateSession
Validates that a session is active and returns basic information about the session and user, can also validate the session against a provided username
- Link: https://webservices.sosstaffing.com/user/validateSession?token=[token]
-
Parameters:
- token
- A JOSSO session ID
- username
- (Optional) Expected username in session
-
Request:
<?xml version="1.0" encoding="UTF-8"?> <request> <username>[username]</username> </request>
-
Response:
<?xml version="1.0" encoding="UTF-8"?> <result> <responseHeader> <status>ok</status> <requestTimeMs>##</requestTimeMs> <token>[token]</token> <params> <username>[username]</username> </params> </responseHeader> <response> <message>Session token refers to a valid session</message> <user_data> <name>[name]</name> <person_id>[person_id]</person_id> <full_name>[full_name]</full_name> <first_name>[first_name]</first_name> <last_name>[last_name]</last_name> <email_address>[email_address]</email_address> <roles> <role>[role]</role> <role>...</role> </roles> </user_data> <session_data> <accessCount>##</accessCount> <creationTime>##</creationTime> <id>[token]</id> <lastAccessTime>##</lastAccessTime> <maxInactiveInterval>##</maxInactiveInterval> <username>[username]</username> <valid></valid> </session_data> </response> </result>