Skip to content

Tools4everBV/HelloID-Conn-Prov-Target-Eduarte-Employee

Repository files navigation

HelloID-Conn-Prov-Target-Eduarte-Medewerker

Important

This connector is not tested with HelloID or with a Eduarte environment!

Important

This connector is not completly finished, it's still required to create the compare in the update script.

Important

This repository contains the connector and configuration code only. The implementer is responsible to acquire the connection details such as username, password, certificate, etc. You might even need to sign a contract or agreement with the supplier before implementing this connector. Please contact the client's application manager to coordinate the connector requirements.

Table of contents

Introduction

HelloID-Conn-Prov-Target-Eduarte-Employee is a target connector. Eduarte-Employee provides a set of SOAP API's that allow you to programmatically interact with its data. This connector only correlates HelloID persons with an employee and user account in eduarte.

The following lifecycle events are available:

Event Description Notes
create.ps1 Create the employee and user account -
update.ps1 Update the employee account -
enable.ps1 Enable the employee account -
disable.ps1 Disable the employee account -
delete.ps1 n/a -

Getting started

Provisioning PowerShell V2 connector

Correlation configuration

The correlation configuration is used to specify which properties will be used to match an existing account within test to a person in HelloID.

To properly setup the correlation:

  1. Open the Correlation tab.

  2. Specify the following configuration:

    Setting Value
    Enable correlation True
    Person correlation field PersonContext.Person.ExternalId
    Account correlation field ``

Tip

For more information on correlation, please refer to our correlation documentation pages.

Field mapping

The field mapping can be imported by using the fieldMapping.json file.

Connection settings

The following settings are required to connect to the API.

Setting Description Mandatory
ApiKey The ApiKey to connect to the API Yes
BaseUrl The URL to the API Yes

Prerequisites

Remarks

  • There is currently no comparison implemented. If this is required for the implementation, it needs to be added. This comparison is listed as a ToDo comment in the Update.ps1

  • the connector facilitates the creation of an employee account as well as an user account. The user account can only be created after the employee account is created. This is because the id of the employee account is necessary in the user account

  • the connector utilizes a sort function in the create and update script. This is because the api expects the properties of the xml object to be in alphabetical order.

  • The current implementation uses custom.person.afkortingscode in the field mapping for afkorting. Populate this with the value needed for your implementation.

  • The field mapping uses gebruiker. and contactgegevens. to create nested objects.

  • By default, the connector correlates with the username and uses it as the account reference. It also assigns the employee a username during the correlation process. However, this could be different in your Eduarte environment. There is an alternative option to correlate using the abbreviation and use that as the account reference. Please verify this during implementation.

    In the code example below you can find a function that retrieves the employee based on the abbreviation

function Get-EduarteMedewerkerWithAbbreviation {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory)]
        [string]$Abbreviation
    )
    process {
        try {
            Write-Information "Getting Eduarte employee for: [$($Abbreviation)]"

            [xml]$soapEnvelope = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.algemeen.webservices.eduarte.topicus.nl/">
    <soapenv:Header/>
    <soapenv:Body>
    <api:getMedewerkerMetAfkorting>
    </api:getMedewerkerMetAfkorting>
    </soapenv:Body>
</soapenv:Envelope>'

            $element = $soapEnvelope.envelope.body.ChildNodes | Where-Object { $_.LocalName -eq 'getMedewerkerMetAfkorting' }
            $element | Add-XmlElement -ElementName 'apiSleutel' -ElementValue "$($actionContext.configuration.ApiKey)"
            $element | Add-XmlElement -ElementName 'afkorting' -ElementValue "$($Abbreviation)"

            $splatGetEmployee = @{
                Method          = 'POST'
                Uri             = "$($actionContext.configuration.BaseUrl.TrimEnd('/'))/services/api/algemeen/medewerkers"
                ContentType     = "text/xml"
                Body            = $soapEnvelope.InnerXml
                UseBasicParsing = $true
            }

            $response = Invoke-WebRequest @splatGetEmployee

            # Check if the response is valid
            if ($response.StatusCode -ne "200") {
                Write-Error "Invalid response: $($response.StatusCode)"
                return $null
            }

            $rawResponse = ([xml]$response.content).Envelope.body
            $employee = $rawResponse.getMedewerkerMetAfkortingResponse.medewerker

            if ([String]::IsNullOrEmpty($employee)) {
                return $null
            }
            else {
                Write-Information "Correlated Eduarte employee for: [$($Abbreviation)]"

                return $employee
            }
        }
        catch {
            throw $_
        }
    }
}

Setup the connector

How to setup the connector in HelloID. Are special settings required. Like the primary manager settings for a source connector.

Getting help

Tip

For more information on how to configure a HelloID PowerShell connector, please refer to our documentation pages.

Tip

If you need help, feel free to ask questions on our forum.

HelloID docs

The official HelloID documentation can be found at: https://docs.helloid.com/