Previous Topic

Next Topic

Inhoudsopgave

Book Index

Appendix A: Configuring an external login option

If you need users to be able to log in from an external system or tool, such as a magnetic key, activate the setting External login allowed. Once it has been activated, a new field will appear in the SFC Settings window on the terminal(s). With this setting in SFC, it is possible to switch the external login option off or on for specific terminals.

After you have configured this, it is necessary to add a bridge from your external system to SFC. For this, you need to add and configure the code that is described below. It will lead from your external system to the Isah Web Services and from there to SFC.

Four REST calls are available to log in through an external system; two for standalone workstations and two for Terminal Server:

Workstation

Terminal Server

In these calls:

The calls need to have the following text in their Authorization header (copy and paste):


“Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJpc3MiOiJJc2FoIEV4dGVybmFsIExvZ2luIFNlcnZpY2UiLCJhdWQiOiJJc2FoIFdlYiBTZXJ2aWNlcyIsIm5iZiI6MTQyMDA2NjgwMCwiZXhwIjoxNzUxNDE0MDQwMCwiSXNhaFVzZXJOYW1lIjoiRXh0ZXJuYWwiLCJFeHRlcm5hbExvZ2luU2VydmljZSI6InRydWUifQ.Q/BMx0wN3DM0Ne+ip/huMVQJ7c0cUI9TNsCq5K6qoOP46TuzZ9JD9i8N4dV73oFM66M8CEyRaL8XM2oor0CBGq+zhCrsvZy3PXv86dw0JerYaaZ+ROGtXDazfD7G9DHrjZAYnxlznimsUggWMZSpXeE323bcYk7WF1YT8K32UDjcyJCD65fT6dnYguol7Y/Un7nBJWB5w30GDY/FJhQ7+N3YAKiuMHcrY2PkDOGkKAbWYPbt3KkXm7CDZznjmmkpvMwWgpU4sNyCJsAgQ1c18YPn50rByJ/yerPLPYESMYQJKRfdvn1Bc57pbljorLNT23k+E15xtRarzJDHoFbp6nhmLubAmw1ggeLdbB+reUROvD+Xl/tV7orkjmfYPxCDg4bZ2G8q5krCiqQsGKfF2P7NspCdOAmzA44RjRUASWRn1PT3InrAGGeiLuH/RD9iA8xAVw+ziCR7CrpkR6yqqKpISy9Xl/qN29lcpensRx/YQ5E3ABPHDsdF02uT9X7vTXCAijOqRYZRTeOWsMA9F1cf9tNcgxUY3bDSsWO6dpCfFAHU4RNqzQtkW22Xr9nVkuzbrG08sdjCk736EME1aqp2lbCKLieiH7n5QtVvfkokpc5jebD4l//LZmeMYX8yH7uYN9vGrwsEg/f61Sh6Sbm1WE9o/h/FhTBpyg+uKiQ=”

Warning: If the calls do not have this code in the Authorization header, the service will give a 403 – Unauthorized error.

If the system can't find an employee when you try the external login, you will see a message stating the problem.

If the system does find an employee, this employee will be logged in and the calls will return an XML of the employee containing the following definition:

<xs:schema xmlns:tns="Isah.Model.Poco" elementFormDefault="qualified" targetNamespace="Isah.Model.Poco" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:complexType name="Employees">

<xs:sequence>

<xs:element minOccurs="0" maxOccurs="unbounded" name="Employee" nillable="true" type="tns:Employee" />

</xs:sequence>

</xs:complexType>

<xs:element name="Employees" nillable="true" type="tns:Employees" />

<xs:complexType name="Employee">

<xs:sequence>

<xs:element minOccurs="0" name="BadgeNr" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="ContractEndDate" nillable="true" type="xs:dateTime" />

<xs:element minOccurs="0" name="ContractStartDate" type="xs:dateTime" />

<xs:element minOccurs="0" name="CostCenterCode" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="CountryCode" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="DeptCode" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="Email" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="EmpId" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="FirstName" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="GenderCode" type="xs:unsignedByte" />

<xs:element minOccurs="0" name="Initials" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="JobDescription" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="LastUpdatedBy" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="LastUpdatedOn" type="xs:dateTime" />

<xs:element minOccurs="0" name="MachGrpCode" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="Name" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="PictureCode" nillable="true" type="xs:int" />

<xs:element minOccurs="0" name="ShortName" nillable="true" type="xs:string" />

<xs:element minOccurs="0" name="Team" nillable="true" type="xs:string" />

</xs:sequence>

</xs:complexType>

<xs:element name="Employee" nillable="true" type="tns:Employee" />

</xs:schema>

Code example C# and .NET

var client = new HttpClient();

client.DefaultRequestHeaders.Authorization = AuthenticationHeaderValue.Parse("Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJpc3MiOiJJc2FoIEV4dGVybmFsIExvZ2luIFNlcnZpY2UiLCJhdWQiOiJJc2FoIFdlYiBTZXJ2aWNlcyIsIm5iZiI6MTQyMDA2NjgwMCwiZXhwIjoxNzUxNDE0MDQwMCwiSXNhaFVzZXJOYW1lIjoiRXh0ZXJuYWwiLCJFeHRlcm5hbExvZ2luU2VydmljZSI6InRydWUifQ.Q/BMx0wN3DM0Ne+ip/huMVQJ7c0cUI9TNsCq5K6qoOP46TuzZ9JD9i8N4dV73oFM66M8CEyRaL8XM2oor0CBGq+zhCrsvZy3PXv86dw0JerYaaZ+ROGtXDazfD7G9DHrjZAYnxlznimsUggWMZSpXeE323bcYk7WF1YT8K32UDjcyJCD65fT6dnYguol7Y/Un7nBJWB5w30GDY/FJhQ7+N3YAKiuMHcrY2PkDOGkKAbWYPbt3KkXm7CDZznjmmkpvMwWgpU4sNyCJsAgQ1c18YPn50rByJ/yerPLPYESMYQJKRfdvn1Bc57pbljorLNT23k+E15xtRarzJDHoFbp6nhmLubAmw1ggeLdbB+reUROvD+Xl/tV7orkjmfYPxCDg4bZ2G8q5krCiqQsGKfF2P7NspCdOAmzA44RjRUASWRn1PT3InrAGGeiLuH/RD9iA8xAVw+ziCR7CrpkR6yqqKpISy9Xl/qN29lcpensRx/YQ5E3ABPHDsdF02uT9X7vTXCAijOqRYZRTeOWsMA9F1cf9tNcgxUY3bDSsWO6dpCfFAHU4RNqzQtkW22Xr9nVkuzbrG08sdjCk736EME1aqp2lbCKLieiH7n5QtVvfkokpc5jebD4l//LZmeMYX8yH7uYN9vGrwsEg/f61Sh6Sbm1WE9o/h/FhTBpyg+uKiQ=");

var response = await client.GetAsync("http://localhost:80/ShopFloorControlService/ShopFloorControl/C0258/Employees/5000");