Skip to content

Methods ~ SCIM queries

Dragos Gaftoneanu edited this page Oct 28, 2019 · 6 revisions

Definitions:

  • /resources/versions/1.1.php
  • /resources/versions/2.0.php

Table of contents

Methods

__construct()

Description: This method instatiates a Database() object into $db, which is used by the other methods to make requests to the database.

createUser($requestBody)

Description: This method takes a request from an identity provider, parses the request and, if checks pass, creates the user in the database and prints the user's SCIM profile.

Parameters:

  • $requestBody
    • the body of the request coming from the identity provider

getUser($userID, $isIncluded='')

Description: This method returns or prints the user's SCIM profile.

Parameters:

  • $userID
    • the user's UUID that will be returned by this method
  • $isIncluded
    • if the attribute is set, then the method will return the user's SCIM profile, otherwise it will print it

listUsers($options)

Description: This method will return the list of users in SCIM format, depending on the options set.

Parameters:

  • $options
    • this attribute was designed to receive the value from $_GET and filter the users based on count, startIndex and filter query parameters

putUser($requestBody, $userID)

Description: This method was designed to handle PUT requests on /Users/$UserID endpoint.

Parameters:

  • $requestBody
    • the body of the request coming from the identity provider
  • $userID
    • the user's UUID that will be modified

patchUser($requestBody, $userID)

Description: This method was designed to handle PATCH requests on /Users/$UserID endpoint.

Parameters:

  • $requestBody
    • the body of the request coming from the identity provider
  • $userID
    • the user's UUID that will be modified

parseUserPayload($payload, $userCheck=false)

Description: This method verifies the user payload sent by an identity provider and, if a check fails, prints an error message.

Parameters:

  • $payload
    • the body of the request coming from the identity provider
  • $userCheck
    • if this attribute is true, then the method will not check if the user already exists in the database

createGroup($requestBody)

Description: This method takes a request from an identity provider, parses the request and, if checks pass, creates the group in the database and prints the group's SCIM profile.

Parameters:

  • $requestBody
    • the body of the request coming from the identity provider

getGroup($groupID, $isIncluded='')

Description: This method returns or prints the group's SCIM profile.

Parameters:

  • $groupID
    • the group's UUID that will be returned by this method
  • $isIncluded
    • if the attribute is set, then the method will return the group's SCIM profile, otherwise it will print it

listGroups($options)

Description: This method will return the list of groups in SCIM format, depending on the options set.

Parameters:

  • $options
    • this attribute was designed to receive the value from $_GET and filter the groups based on count, startIndex and filter query parameters

patchGroup($requestBody, $groupID)

Description: This method was designed to handle PATCH requests on /Groups/$GroupID endpoint.

Parameters:

  • $requestBody
    • the body of the request coming from the identity provider
  • $groupID
    • the group's UUID that will be modified

putGroup($requestBody, $groupID)

Description: This method was designed to handle PUT requests on /Groups/$GroupID endpoint.

Parameters:

  • $requestBody
    • the body of the request coming from the identity provider
  • $groupID
    • the group's UUID that will be modified

parseGroupPayload($payload, $groupCheck=false)

Description: This method verifies the group payload sent by an identity provider and, if a check fails, prints an error message.

Parameters:

  • $payload
    • the body of the request coming from the identity provider
  • $groupCheck
    • if this attribute is true, then the method will not check if the group already exists in the database

showServiceProviderConfig()

Description: This method returns the SCIM server details for /ServiceProviderConfig endpoint.

throwError($statusCode, $description)

Description: This method returns an error based on the status code and description.

Parameters:

  • $statusCode
    • the status code that will be returned in the header and body
  • $description
    • the message that will be returned when the error occurred