<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.heidler-strichcode.de/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Odelice</id>
	<title>Wiki - Heidler Strichcode GmbH - Benutzerbeiträge [de]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.heidler-strichcode.de/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Odelice"/>
	<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Spezial:Beitr%C3%A4ge/Odelice"/>
	<updated>2026-04-30T15:31:59Z</updated>
	<subtitle>Benutzerbeiträge</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Carrier_API_error_codes&amp;diff=6268</id>
		<title>Carrier API error codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Carrier_API_error_codes&amp;diff=6268"/>
		<updated>2026-03-24T15:12:54Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Carrier_API_Fehlercodes]]&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
Error codes in the Carrier API appear in the following form &amp;lt;code&amp;gt;AAA-SSS-GG-L[Code]&amp;lt;/code&amp;gt;, where&lt;br /&gt;
* AAA = Application, in this case only CAP for CarrierAPI&lt;br /&gt;
* SSS = Sub group, in this case the plugin. A list of plugins can be found further down.&lt;br /&gt;
* GG = Error group, this divides the errors in categories, where the cause normally originates from&lt;br /&gt;
* L = Error-level, the severeness of the error: W = Warning, E = Error, C = Critical, F = Fatal&lt;br /&gt;
* [Code] = A numerical Code that clearly assigns the error in this group.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example: &amp;lt;code&amp;gt;CAP-HEH-02-E00005&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Means there is an error in the Hermes HSI module in group 02 (content-related error) with code 5 (authentification failed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To search for an error, search on this site &amp;lt;code&amp;gt;(Strg+F)&amp;lt;/code&amp;gt; with the acutal code.&lt;br /&gt;
&lt;br /&gt;
If you can not find the code directly, replace the sub group, e.g. &amp;quot;HEH&amp;quot; with &amp;lt;code&amp;gt;XXX&amp;lt;/code&amp;gt;. From the top example: &amp;lt;code&amp;gt;CAP-XXX-02-E00005&amp;lt;/code&amp;gt;. This code is available in group 02.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Group 00 - Fundamental errors ==&lt;br /&gt;
These errors appear if the error cause is unknown (e.g. 00000 - undefined error) or when a fundamental problem lies within the functionalities of the Carrier API.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-00-E00000 || Error in webservice request: [Error message] || Error cause unknown. Examine exact error message, if necessary check logs.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-00-E00001 || Unable to create plugin || Problem when calling the webservice plugin. Please contact support&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-00-E00002 || The selected Carrier API plugin has been deprecated. Please contact Heidler Support || The selected Carrier API plugin is deprecated and the webservice is discontinued by the carrier. Please contact support&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Group 01 - Technical errors in the request ==&lt;br /&gt;
These errors appear if the request was not successful due to a technical error. They can be temporary problems, e.g. the server is not accessible (00001 - connection error) or overloaded (00002 - Read timeout).  Or fundamental problems which require interference (00004 - certificate error).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-C00001 || [Connection error / Connection timeout] Unable to connect to webservice. Please check your internet connection, url, firewall, or proxy settings. || Connection error: No connection possible. Maybe the request was blocked.&lt;br /&gt;
Connect timeout: The Carrier API could not determine that the connection was blocked. Maybe the connection quality is insufficient.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-E00002 || Read timeout: The webservice did not respond in a timely manner. || Normally, the server of the carrier is overloaded. You can try to increase the Read timeout in the general settings or for this specific endpoint.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-C00003 || DNS error: The url [URL] is unknown || Your DNS-Server blocks the request of the Carrier API or the URL set is not correct.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-C00004 || Unable to verify webservice certificate. Please check your firewall or url. || If your firewall contains a deep packet inspection, it provides a certificate in between, which is unknown to the Carrier API. The Carrier API interprets it as a [https://de.wikipedia.org/wiki/Man-in-the-Middle-Angriff Man-in-the-Middle-Angriff].&lt;br /&gt;
If you trust the certificate, you can save it X.509 coded under [CarrierAPI]\config\certs.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-F00005 || Deserialization error: The webservice returned an invalid document || Please contact support.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-E00006 || Label conversion error || Please contact support.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Group 02 - Content-related errors in the request ==&lt;br /&gt;
The communication with the webservice was successful, but the response does not math the expectation. Normally, the webservice has found an error in the request (shipment data set) and returns it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00001 || General response error || The Carrier API can not assign the error. Please check the exact error message to this error code.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00002 || Webservice returned error: [Error message] || The webservice has responded with an exact error code and/or error message. Please check it and correct the data set if necessary.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00003 || Webservice returned an invalid response: [Error detail] || The response from the webservice does not match the conventions known by the Carrier API. Possibly some mandatory fields are missing in the response (e.g. tracking number or label data). Please check the eroor details and contact the support if necessary.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00004 || Webservice returned HTTP [HTTP-Code] || No detailed error details are known except for the webservice respoding with a &amp;quot;not OK&amp;quot;.&lt;br /&gt;
In the logs of the Carrier API you can normally findthe whole response from the webservice wich may contain more details.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00005 || Authentication with the webservice failed. Please check your login details. || Normally the access data set in the Carrier API is wrong or the carrier has not unlocked your account yet.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00006 || The webservice did not change the shipment status within a reasonable amount of time (asynchronous webservice operation). &lt;br /&gt;
| With asynchronous webservices (e.g. Inpost24 or FedEx Stratus), the Carrier API waits until the webservice responds with a Completed or Error status. If this does not occur in time, the Carrier API throws this error.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Group 03 - Validation error ==&lt;br /&gt;
For some carriers, the Carrier API executes a limited validation and returns an error even before the request to the webservice, when it is predictable that the request is not accepted by the carrier.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00001 || Validation error: [Error details] || Validation error which does not fit the following categories. Please check the error details.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00002 || Invalid reference number || The webservice needs a clear reference number (e.g. delivery note number)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00003 || Receiver address is invalid || e.g. missing PLZ, street, house no. etc.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00004 || Street and house number needs to be separated &lt;br /&gt;
| Street and house no. need to be separated in the shipment. The separation was not configured in the HVS32 (contact support) or the separation was not successful (check data set: house no. at the end or start of the street?)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00005 || Unable to separate first and last name for: [Name] || For the separation of first and last name, you need two words.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00006 || Invalid incoterm id || A completely missing incoterm or the carrier ony accepts specific incoterms.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00007 || Target date is invalid || A service was selected that expects a target date. It is not filled or is in the past.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00008 || Customer / account number is invalid || The customer number in the HVS32 configurator or the user in the Carrier API configurator does not match the conditions of the carrier (e.g. numerical).&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00009 || Shipment number is invalid || The HVS32 should create a shipment number (contact support) or expects it from the host system (check data set).&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00010 || Tracking number is invalid || The HVS32 should create a tracking number (contact support) or expects it from the host system (check data set).&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00011 || Service type id is invalid || The configured service is invalid for this carrier.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00012 || Invalid e-mail address || This shipment needs an email address with the selected service. It has not been delivered. Please check the data set.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00013 || Invalid phone number || This shipment needs a phone number with the selected service. It has not been delivered. Please check the data set.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00014 || Invalid value of goods || This shipment needs the value of goods with the selected service. It has not been delivered or it s an invalid number. Please check the data set.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00015 || Invalid insurance value || This shipment needs an insurance value with the selected service. It has not been delivered or it s an invalid number. Please check the data set.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00016 || Invalid id for parcel shop || A parcel shop shipment has been selected for this shiment. But the corresponding parcel shop id is missing or invalid (e.g. numerical).&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00017 || The requested service requires additional data. || A specific service has been selected for this shipment. But additional information for this service is missing that is necessary.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00030 || Weight is invalid || The chosen package weight does not match the conditions of the carrier (e.g. 0kg or more than the carrier accepts). Please check the data set.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00031 || Package dimensions are invalid. || The carrier expects package dimensions that are missing in the data set. Please check the data set.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00032 || Package type id is invalid || The package type is completely missing or the carrier only accepts specifc package types.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00033 || Package contents are invalid || This shipment needs the package content with the selected service. It has not been delivered. Please check the data set.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00038 || No article data available in package || Shipments outside of the EU normally require additional article data to correctly transfer the customs information.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00039 || No hazardous goods data available in package || The selceted service is a dangerous goods service. But the dangerous goods data is missing in the data set.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Group 04 - Configuration error ==&lt;br /&gt;
Errors in group 04 mostly have their cause due to a not fully configurated module in the HVS32 or in the Carrier API. It is also possible that the data set is incorrect and refers to a false configuration (e.g. when an invalid dispatch type ID is sent).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CAP-000-04-C00001 || No dispatch type found for id: [Dispatch type ID] || The Carrier API can not find a configuration entry with the chosen dispatch type ID.The configuration is incomplete or the transferred dispatch type ID is wrong.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-000-04-C00002 || No client found for id: [Client ID] || The Carrier API can not find a configuration entry with the chosen client ID.The configuration is incomplete or the transferred client ID is wrong.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-000-04-C00003 || Plugin [Plugin] is not licensed || The dispatch type or rather the endpoint refers to a carrier plugin has not been licensed yet or is not anymore. Please contact the support.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-04-C00004 || No endpoint defined for dispatch type: [Dispatch type ID] || The selected dispatch type has been found in the Carrier API but not the endpoint, which the dispatch type refers to. Please contact the support.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-04-C00005 || Endpoint url is invalid: [URL] || The configured URL in the endpoint is invalid. Please contact the support.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-04-C00006 || Invalid configuration for: [Configuration details] || A carrier specific configuration is incomplete. Please check the detailed error message for more details.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Carrier-specific errors ==&lt;br /&gt;
Some carriers have special error codes that can not be be generally assigned. In most cases, it is an extended validation error from group 03.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GLS Ship IT ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CAP-GLS-03-E00050 || Invalid GLS contact id || Die im HVS32 konfigurierte Contact ID fehlt oder ist ungültig&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hermes Shipping Interface (HSI) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CAP-HEH-03-E00050 || Invalid package type and dimensions. At least one is required. || Hermes hat Verpackungen im Format XS, S, M, L, XL&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-HEH-03-E00051 || Invalid birthday for ident service || Für diese Sendung wurde ein Ident-Service gewählt. Das Geburtsdatum fehlt allerdings oder handelt sich nicht um ein gültiges Datum.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Schenker AT ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Description&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00050 || Error in hazardous goods dataset. Invalid UN number. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die UN-Nummer&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00051 || Error in hazardous goods dataset. Invalid DG class. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die GG-Klasse.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00052 || Error in hazardous goods dataset. Invalid dg weight. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie das GG-Gewicht.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00053 || Error in hazardous goods dataset. Invalid package type. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die GG-Verpackungsart.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00054 || Error in hazardous goods dataset. Invalid dg package group. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die GG-Verpackungsgruppe.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00055 || Error in hazardous goods dataset. Invalid shipping name. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die GG-Bezeichnung&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00056 || Error in hazardous goods dataset. No net explosive mass defined for dg class 1. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die Netto-Explosivmasse. Außerdem: Wurde mit Schenker AT abgesprochen, dass Sie Torpedos verschicken?&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00057 || Error in hazardous goods dataset. Invalid unit of measurement. &lt;br /&gt;
| Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie den Mengen-Typ (kg oder l)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin codes ==&lt;br /&gt;
Each plugin has its own sub-group for an error code. All plugins are listed in the following.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Plugin&lt;br /&gt;
|-&lt;br /&gt;
| 000 || Unbekannt - Plugin konnte noch nicht ermittelt werden&lt;br /&gt;
|-&lt;br /&gt;
| ACO || Arco&lt;br /&gt;
|-&lt;br /&gt;
| AGX || AGX&lt;br /&gt;
|-&lt;br /&gt;
| AMZ || Amazon Merchant Fulfillment&lt;br /&gt;
|-&lt;br /&gt;
| ANL || ANGEL&lt;br /&gt;
|-&lt;br /&gt;
| ASE || Asendia&lt;br /&gt;
|-&lt;br /&gt;
| ASM || Amazon Selling Partner API - Merchant Fulfillment&lt;br /&gt;
|-&lt;br /&gt;
| ASV || Amazon Selling Partner API - Vendor Direct&lt;br /&gt;
|-&lt;br /&gt;
| ATL || Atlas&lt;br /&gt;
|-&lt;br /&gt;
| CAL || Canis Lupus&lt;br /&gt;
|-&lt;br /&gt;
| CEN || Centiro&lt;br /&gt;
|-&lt;br /&gt;
| CHR || Chronopost&lt;br /&gt;
|-&lt;br /&gt;
| CIP || Citipost&lt;br /&gt;
|-&lt;br /&gt;
| COU || Coureon&lt;br /&gt;
|-&lt;br /&gt;
| DBB || DHL ES B2B&lt;br /&gt;
|-&lt;br /&gt;
| DCS || DCS&lt;br /&gt;
|-&lt;br /&gt;
| DEC || DHL eConnect&lt;br /&gt;
|-&lt;br /&gt;
| DEL || DHL Express Routing Live&lt;br /&gt;
|-&lt;br /&gt;
| DET || DHL Express Routing Test&lt;br /&gt;
|-&lt;br /&gt;
| DFR || DPD FR (Frankreich)&lt;br /&gt;
|-&lt;br /&gt;
| DHA || DHL ELP (Abholung)&lt;br /&gt;
|-&lt;br /&gt;
| DHE || DHL ES B2C&lt;br /&gt;
|-&lt;br /&gt;
| DHH || DHL Global Web Service (Ungarn)&lt;br /&gt;
|-&lt;br /&gt;
| DHN || DHL NL&lt;br /&gt;
|-&lt;br /&gt;
| DHP || DHL 24 PL&lt;br /&gt;
|-&lt;br /&gt;
| DHS || DHL SK (Slowakei)&lt;br /&gt;
|-&lt;br /&gt;
| DIM || Internetmarke (Deutsche Post)&lt;br /&gt;
|-&lt;br /&gt;
| DPA || DPD AT (Österreich)&lt;br /&gt;
|-&lt;br /&gt;
| DPL || DPD PL (Polen)&lt;br /&gt;
|-&lt;br /&gt;
| DPC || DPD HR (Kroatien)&lt;br /&gt;
|-&lt;br /&gt;
| DPH || DPD HU (Ungarn)&lt;br /&gt;
|-&lt;br /&gt;
| DPP || DPD DE Parcelshop Suche&lt;br /&gt;
|-&lt;br /&gt;
| DPR || DPD RO (Rumänien)&lt;br /&gt;
|-&lt;br /&gt;
| DNL || DPD NL (Niederlande)&lt;br /&gt;
|-&lt;br /&gt;
| DRI || DHL Retoure International&lt;br /&gt;
|-&lt;br /&gt;
| DRL || DHL Retoure International (Legacy - veraltet)&lt;br /&gt;
|-&lt;br /&gt;
| DSK || Danske&lt;br /&gt;
|-&lt;br /&gt;
| DVF || AM.Exchange (DV-Freimachung)&lt;br /&gt;
|-&lt;br /&gt;
| EPK || Europaket&lt;br /&gt;
|-&lt;br /&gt;
| FED || Fedex&lt;br /&gt;
|-&lt;br /&gt;
| FAC || Fiege Amazon Carma&lt;br /&gt;
|-&lt;br /&gt;
| FTD || Fedex Trade Documents&lt;br /&gt;
|-&lt;br /&gt;
| FXA || Fedex (Abholung)&lt;br /&gt;
|-&lt;br /&gt;
| FXP || Fedex PL (Polen)&lt;br /&gt;
|-&lt;br /&gt;
| FXS || Fedex Stratus REST API&lt;br /&gt;
|-&lt;br /&gt;
| GEO || Geodis&lt;br /&gt;
|-&lt;br /&gt;
| GLD || GLS DK (Dänemark)&lt;br /&gt;
|-&lt;br /&gt;
| GLE || GLS ES (Spanien)&lt;br /&gt;
|-&lt;br /&gt;
| GLF || GLS FR (Frankreich)&lt;br /&gt;
|-&lt;br /&gt;
| GLH || GLS HU (Ungarn)&lt;br /&gt;
|-&lt;br /&gt;
| GLI || GLS IT (Italien)&lt;br /&gt;
|-&lt;br /&gt;
| GLK || GLS SK (Slowakei)&lt;br /&gt;
|-&lt;br /&gt;
| GLL || GLS CZ (Tschechien)&lt;br /&gt;
|-&lt;br /&gt;
| GLN || GLS NL (Niederlande)&lt;br /&gt;
|-&lt;br /&gt;
| GLO || Glovo&lt;br /&gt;
|-&lt;br /&gt;
| GLP || GLS PL (Polen)&lt;br /&gt;
|-&lt;br /&gt;
| GLS || GLS DE / Ship IT (Deutschland)&lt;br /&gt;
|-&lt;br /&gt;
| GPP || General Purpose (konfigurierbar), auch G00 - G99&lt;br /&gt;
|-&lt;br /&gt;
| GPS || GLS Parcel Shop (GLS DE Parcelshop Suche)&lt;br /&gt;
|-&lt;br /&gt;
| GSA || GLS AT / Ship IT (Österreich)&lt;br /&gt;
|-&lt;br /&gt;
| GSD || GLS DK / Ship IT (Dänemark)&lt;br /&gt;
|-&lt;br /&gt;
| GSF || GLS FR / Ship IT (Frankreich)&lt;br /&gt;
|-&lt;br /&gt;
| GTT || GLS DE Track &amp;amp; Trace&lt;br /&gt;
|-&lt;br /&gt;
| HBG || Hermes Border Guru&lt;br /&gt;
|-&lt;br /&gt;
| HEH || Hermes Shipping Interface (HSI)&lt;br /&gt;
|-&lt;br /&gt;
| HES || Hermes Einrichtungs Service (HES)&lt;br /&gt;
|-&lt;br /&gt;
| HRB || Hornbach&lt;br /&gt;
|-&lt;br /&gt;
| HMP || Hellmann PL (Polen)&lt;br /&gt;
|-&lt;br /&gt;
|ICS || ICS&lt;br /&gt;
|-&lt;br /&gt;
| INP || Inpost24&lt;br /&gt;
|-&lt;br /&gt;
| IZP || Infens Zustellprofi&lt;br /&gt;
|-&lt;br /&gt;
|KOV || Kommt Overnight&lt;br /&gt;
|-&lt;br /&gt;
| KUR || Der Kurier&lt;br /&gt;
|-&lt;br /&gt;
| LFG || Liefergrün&lt;br /&gt;
|-&lt;br /&gt;
| LGX || Log X Star&lt;br /&gt;
|-&lt;br /&gt;
| MON || Mondial Relay&lt;br /&gt;
|-&lt;br /&gt;
| NCX || Nacex&lt;br /&gt;
|-&lt;br /&gt;
| OMS || Omest&lt;br /&gt;
|-&lt;br /&gt;
| ONT || Ontime&lt;br /&gt;
|-&lt;br /&gt;
| PAT || Post AT (Österreich)&lt;br /&gt;
|-&lt;br /&gt;
| PFI || Posti FI (Finnland)&lt;br /&gt;
|-&lt;br /&gt;
| PHR || Posti HR (Kroatien)&lt;br /&gt;
|-&lt;br /&gt;
| PIL || Pilot&lt;br /&gt;
|-&lt;br /&gt;
| PPL || PPL&lt;br /&gt;
|-&lt;br /&gt;
| PSI || Post SI (Slovenien)&lt;br /&gt;
|-&lt;br /&gt;
| PSK || Post SK (Slovakei)&lt;br /&gt;
|-&lt;br /&gt;
| SES || Seven Senders (7senders)&lt;br /&gt;
|-&lt;br /&gt;
| SHA || Schenker AT (Österreich)&lt;br /&gt;
|-&lt;br /&gt;
| SHD || Schenker&lt;br /&gt;
|-&lt;br /&gt;
| SHS || Schenker SE (Schweden)&lt;br /&gt;
|-&lt;br /&gt;
| SND || Sending&lt;br /&gt;
|-&lt;br /&gt;
| TBN || TNT NL - Retoure Belgien&lt;br /&gt;
|-&lt;br /&gt;
| TMP || TMParcel&lt;br /&gt;
|-&lt;br /&gt;
| TNF || TNT FR (Frankreich)&lt;br /&gt;
|-&lt;br /&gt;
| TNI || TNT IT (Italien)&lt;br /&gt;
|-&lt;br /&gt;
| TNN || TNT Post NL (Niederlande)&lt;br /&gt;
|-&lt;br /&gt;
| TNT || TNT (Deutschland)&lt;br /&gt;
|-&lt;br /&gt;
| TOH || TOF HU (Ungarn)&lt;br /&gt;
|-&lt;br /&gt;
| TPN || TPN&lt;br /&gt;
|-&lt;br /&gt;
| TRA || Tradebyte&lt;br /&gt;
|-&lt;br /&gt;
| TRM || Tiramizoo&lt;br /&gt;
|-&lt;br /&gt;
| UPA || UPS Pickup (Abholung)&lt;br /&gt;
|-&lt;br /&gt;
| UPG || UPS GG (Gefahrgut PreAvis)&lt;br /&gt;
|-&lt;br /&gt;
| UPP || UPS Paperless Document&lt;br /&gt;
|-&lt;br /&gt;
| UPT || UPS Tarifierung &lt;br /&gt;
|-&lt;br /&gt;
| VNP || Venipak&lt;br /&gt;
|-&lt;br /&gt;
| WYF || Wayfair&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Carrier_API_Fehlercodes&amp;diff=6267</id>
		<title>Carrier API Fehlercodes</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Carrier_API_Fehlercodes&amp;diff=6267"/>
		<updated>2026-03-24T15:12:12Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Carrier_API_error_codes]]&lt;br /&gt;
&lt;br /&gt;
== Allgemeines ==&lt;br /&gt;
Fehlercodes in der Carrier API sind nach dem Schema &amp;lt;code&amp;gt;AAA-SSS-GG-L[Code]&amp;lt;/code&amp;gt;, wobei&lt;br /&gt;
* AAA = Applikation, in diesem Fall nur CAP für Carrier API&lt;br /&gt;
* SSS = Subgruppe, in diesem Fall das Plugin. Eine Auflistung der Plugins finden Sie weiter unten.&lt;br /&gt;
* GG = Fehlergruppe, diese teilt den Fehler in Kategorien, woher die Ursache in der Regel kommt&lt;br /&gt;
* L = Fehler-Level, wie schwerwiegend der Fehler ist: W = Warning, E = Error, C = Critical, F = Fatal&lt;br /&gt;
* [Code] = Ein numerischer Code, welche den Fehler in dieser Gruppe eindeutig zuordnet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Beispiel: &amp;lt;code&amp;gt;CAP-HEH-02-E00005&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bedeutet in diesem Fall ein Fehler innerhalb des Hermes HSI Moduls in der Gruppe 02 (Inhaltliche Fehler) mit dem Code 5 (Authentifizierung fehlgeschlagen).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Um einen Fehler zu suchen, suchen Sie bitte auf dieser Seite &amp;lt;code&amp;gt;(Strg+F)&amp;lt;/code&amp;gt; zunächst mit dem eigentlichen Code.&lt;br /&gt;
&lt;br /&gt;
Falls Sie den Code nicht direkt finden können, ersetzen Sie bitte die Subgruppe z.B. &amp;quot;HEH&amp;quot; durch &amp;lt;code&amp;gt;XXX&amp;lt;/code&amp;gt;. Aus dem obigen Beispiel: &amp;lt;code&amp;gt;CAP-XXX-02-E00005&amp;lt;/code&amp;gt;. Dieser Code ist in der Gruppe 02 vorhanden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Gruppe 00 - Grundlegende Fehler ==&lt;br /&gt;
Diese Fehler treten auf, wenn die Fehlerursache nicht bekannt ist (z.B. 00000 - Undefinierter Fehler) oder ein grundlegendes Problem in der Funktionweise der Carrier API vorliegt.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-00-E00000 || Fehler in Webservice Anfrage: [Fehlermeldung] || Fehlerursache nicht bekannt. Genaue Fehlermeldung untersuchen, ggf. Logs einsehen.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-00-E00001 || Plugin kann nicht erstellt werden || Problem beim aufrufen des jeweiligen Webservice-Plugins. Bitte Support kontaktieren&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-00-E00002 || Plugin veraltet || Das gewählte Carrier API Plugin ist veraltet und der Webservice wurde vom Frachtführer abgekündigt. Bitte Support kontaktieren&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Gruppe 01 - Technische Fehler in der Anfrage ==&lt;br /&gt;
Diese Fehler treten auf, wenn die Anfrage aufgrund eines technischen Fehlers nicht erfolgreich war.&lt;br /&gt;
Dies können temporäre Probleme sein, wenn der Server z.B. nicht erreichbar ist (00001 - Verbindungsfehler) oder überlastet ist (00002 - Read timeout).&lt;br /&gt;
Oder aber grundlegende Probleme welche einen Eingriff erfordern (00004 - Zertifikatsfehler).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-C00001 || [Connection error / Connection timeout] Es konnte keine Verbindung zum Webservice hergestellt werden. Bitte prüfen Sie Ihre Internet-Verbindung, URL, Firewall-, oder Proxy-Einstellungen. || Connection error: Verbindung nicht möglich. Eventuell wurde die Anfrage blockiert.&lt;br /&gt;
Connect timeout: Die Carrier API konnte nicht feststellen, dass die Verbindung blockiert wurde. Eventuell ist die Verbindungsqualität nicht ausreichend.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-E00002 || Read timeout: Der Webservice hat nicht rechtzeitig auf die Anfrage reagiert. || In der Regel ist der Server vom Frachtführer überlastet. Sie können in den allgemeinen Einstellungen oder für diesen Endpoint versuchen, den Read timeout auf einen höheren Wert zu stellen.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-C00003 || DNS Fehler: Die URL [URL] ist unbekannt || Entweder blockiert Ihr DNS-Server die Anfrage der Carrier API oder die hinterlegte URL ist nicht korrekt.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-C00004 || Zertifikat vom Webservice kann nicht verifiziert werden. Bitte prüfen Sie Ihre Firewall oder URL. || Falls Ihre Firewall eine deep packet inspection enthält, stellt Sie ein Zwischen-Zertifikat bereit, welches der Carrier API nicht bekannt ist. Das wird von der Carrier-API als [https://de.wikipedia.org/wiki/Man-in-the-Middle-Angriff Man-in-the-Middle-Angriff] interpretiert.&lt;br /&gt;
Wenn Sie dem Zertifikat vertrauen, können Sie es X.509 kodiert unter [CarrierAPI]\config\certs hinterlegen.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-F00005 || Deserialisierungsfehler: Der Webservice hat ein ungültiges Dokument zurückgemeldet. || Bitte Support kontaktieren.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-01-E00006 || Labelkonvertierung fehlgeschlagen || Bitte Support kontaktieren.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Gruppe 02 - Inhaltliche Fehler in der Anfrage ==&lt;br /&gt;
Die Kommunikation mit dem Webservice war erfolgreich, allerdings entspricht die Antwort nicht der Erwartung. In der Regel hat der Webservice einen Fehler in der Anfrage (Sendungsdatensatz) gefunden und gibt diesen zurück.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00001 || Allgemeiner Rückmeldungs-Fehler || Die Carrier API kann den Fehler nicht genau zuordnen. Bitte prüfen Sie die genaue Fehlermeldung zu diesem Fehlercode.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00002 || Fehler vom Webservice: [Fehlertext] || Der Webservice hat einen genauen Fehlercode und/oder Fehlertext zurückgemeldet. Bitte diesen genau prüfen und ggf. den Datensatz korrigieren.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00003 || Ungültige Antwort von Webservice: [Fehler-Detail] || Die Antwort vom Webservice entspricht nicht den Konventionen, welche der Carrier API bekannt sind. Es fehlen u.U. Pflichtfelder in der Antwort (z.B. Tracking-Nummer oder Label-Daten). Bitte prüfen Sie die Fehler-Details und kontaktieren Sie ggf. den Support.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00004 || Webservice hat HTTP [HTTP-Code] zurückgegeben || Es sind keine genauen Fehler-Details bekannt, außer dass der Webservice generell ein &amp;quot;Nicht-OK&amp;quot; zurückgegeben hat.&lt;br /&gt;
In den Logs der Carrier API finden Sie in der Regel die gesamte Antwort des Webservice, welche eventuell weitere Details enthalten.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00005 || Authentifizierung mit dem Webservice fehlgeschlagen. Bitte prüfen Sie Ihre Zugangsdaten. || In der Regel sind die in der Carrier API hinterlegten Zugangsdaten falsch, oder der Frachtführer hat Ihren Account noch nicht freigeschaltet.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-02-E00006 || Der Webservice hat den Sendungsstaus nicht in angemessener Zeit geändert || Bei asynchronen Webservices (z.B: Inpost24 oder FedEx Stratus) wartet die Carrier API bis vom Webservice ein Abgeschlossen- oder Fehler-Status zurück kommt. Sollte dies nicht rechtzeitig erfolgen, dann wirft die Carrier API diesen Fehler.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Gruppe 03 - Validierungsfehler ==&lt;br /&gt;
Bei manchen Frachtführern führt die Carrier API eine begrenzte Validierung selbst durch und gibt bereits vor der Anfrage an den Webservice einen Fehler zurück, wenn absehbar ist, dass diese Anfrage beim Frachtführer nicht akzeptiert wird.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00001 || Validierungsfehler: [Fehler-Details] || Validierungsfehler, welcher nicht unter einer der folgenden Kategorien zutrifft. Bitte die Fehler-Details prüfen.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00002 || Ungültige Referenznummer || Der Webservice benötigt eine eindeutige Referenz-Nummer (z.B. Lieferschein-Nr.)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00003 || Empfänger Adresse ist ungültig || z.B. fehlende PLZ, Straße, Haus-Nr. usw.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00004 || Straße und Hausnummer muss getrennt werden || In der Sendung müssen Straße und Hausnummer separiert werden. Entweder wurde die Trennung im HVS32 nicht konfiguriert (Support kontaktieren) oder die Trennung war nicht erfolgreich (Datensatz kontrollieren: Hausnummer ganz am Ende oder Anfang der Straße?)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00005 || Trennung von Vor- und Nachname nicht möglich für: [Name] || Für die Trennung von Vor- und Nachnamen sind immer zwei Wörter erforderlich.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00006 || Ungültige Frankatur/Incoterm || Entweder fehlt eine Frankatur komplett oder der Frachtführer akzeptiert nur ganz bestimmte Frankaturen.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00007 || Termin Datum ist nicht gültig || Es wurde ein Dienst ausgewählt welcher ein Termin-Datum erwartet. Dieses ist entweder nicht belegt oder liegt in der Vergangenheit.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00008 || Kunden- / Account-Nr. ist ungültig || Die Kunden-Nr. im HVS32-Konfigurator oder der Benutzer im Carrier API Konfigurator entspricht nicht den Vorgaben des Frachtführers (z.B. numerisch).&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00009 || Sendungsnummer ist ungültig || Das HVS32 sollte eigentlich eine (Versand-)Sendungs-Nummer erzeugen (Support kontaktieren) oder erwartet diese aus dem Vorsystem (Datensatz prüfen).&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00010 || Trackingnummer ist ungültig || Das HVS32 sollte eigentlich eine Trackingnummer erzeugen (Support kontaktieren) oder erwartet diese aus dem Vorsystem (Datensatz prüfen).&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00011 || Sonderdienst-ID ist ungültig || Der konfigurierte Dienst ist für diesen Frachtführer nicht gültig.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00012 || Ungültige E-Mail Adresse || Diese Sendung benötigt mit dem gewählten Dienst eine E-Mail Adresse. Diese wurde nicht übergeben. Bitte prüfen Sie den Datensatz.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00013 || Ungültige Telefonnummer || Diese Sendung benötigt mit dem gewählten Dienst eine Telefon-Nummer. Diese wurde nicht übergeben. Bitte prüfen Sie den Datensatz.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00014 || Ungültiger Warenwert || Diese Sendung benötigt mit dem gewählten Dienst einen Warenwert. Diese wurde nicht übergeben oder ist keine gültige Zahl. Bitte prüfen Sie den Datensatz.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00015 || Ungültiger Versicherungswert || Diese Sendung benötigt mit dem gewählten Dienst einen Versicherungswert. Diese wurde nicht übergeben oder ist keine gültige Zahl. Bitte prüfen Sie den Datensatz.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00016 || Ungültige ID für Paketshop || Für diese Sendung wurde eine Paketshop-Lieferung gewählt. Allerdings fehlt die dazugehörige Paketshop-ID oder sie ist nicht gültig (z.B. numerisch).&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00017 || Fehlende Information für gewählten Service || Für diese Sendung wurde ein spezifischer Dienst gewählt. Allerdings fehlen für diesen Dienst zusätzliche Informationen, welche nun notwendig sind.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00030 || Gewicht ist ungültig || Das angegebene Packstück-Gewicht entspricht nicht den Vorgaben des Frachtführers (z.B. 0 kg oder mehr als der Frachtführer akzeptiert). Bitte prüfen Sie den Datensatz.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00031 || Paketabmessungen sind ungültig. || Der Frachtführer erwartet Paketabmessungen welche im Datensatz fehlen. Bitte prüfen Sie den Datensatz. &lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00032 || Verpackungart-ID ist ungültig || Entweder fehlt die Verpackungsart komplett oder der Frachtführer akzeptiert nur ganz bestimmte Verpackungsarten.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00033 || Paketinhalt ist ungültig || Diese Sendung benötigt mit dem gewählten Dienst den Paketinhalt. Dieser wurde nicht übergeben. Bitte prüfen Sie den Datensatz.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00038 || Keine Artikeldaten im Packstück vorhanden || Sendungen ins EU-Ausland benötigen in der Regel zusätzlich Artikeldaten um die Zollinformationen korrekt zu übergeben.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-03-E00039 || Keine Gefahrgutdaten im Packstück vorhanden || Beim gewählten Dienst handelt es sich um einen Gefahrgut-Dienst. Allerdings fehlen im Datensatz die Gefahrgutdaten.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Gruppe 04 - Konfigurationsfehler ==&lt;br /&gt;
Fehler der Gruppe 04 haben Ihre Ursache meist in einem nicht vollständig konfiguriertem Modul im HVS32 oder in der Carrier API. Unter Umständen kann aber auch der Datensatz fehlerhaft sein und auf eine falsche Konfiguration verweisen (z.B. wenn eine ungültige Versandart übergeben wurde).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| CAP-000-04-C00001 || Keine Versandart gefunden für ID: [Versandart-ID] || Die Carrier API kann keinen Konfigurationseintrag mit der gewählten Versandart-ID finden. Entweder ist die Konfiguration unvollständig oder die übergebene Versandart-ID ist falsch.&lt;br /&gt;
|-&lt;br /&gt;
| CAP-000-04-C00002 || Kein Auftragggeber gefunden für ID: [Auftraggeber-ID] || Die Carrier API kann keinen Konfigurationseintrag mit der gewählten Auftraggeber-ID finden. Entweder ist die Konfiguration unvollständig oder die übergebene Auftraggeber-ID ist falsch.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-000-04-C00003 || Plugin [Plugin] ist nicht lizensiert || Die Versandart bzw. der Endpoint verweist auf ein Frachtführer-Plugin welches noch nicht oder nicht mehr lizensiert ist. Bitte kontaktieren Sie den Support.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-04-C00004 || Kein Endpoint definiert für Versandart: [Versandart-ID] || Die gewählte Versandart wurde in der Carrier API gefunden allerdings nicht den Endpoint, auf welche diese Versandart verweist. Bitte kontaktieren Sie den Support.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-04-C00005 || Endpoint URL ist ungültig: [URL] || Bei der im Endpoint konfigurierten URL handelt es sich nicht um eine gültige URL. Bitte kontaktieren Sie den Support.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-XXX-04-C00006 || Ungültige Konfiguration für: [Konfigurations-Details] || Eine Frachtführer-spezifische Konfiguration ist unvollständig. Bitte prüfen Sie die Detaillierte Fehlermeldung für mehr Details&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Frachtführer-Spezifische Fehler ==&lt;br /&gt;
Manche Frachtführer haben spezialisierte Fehlercodes, sofern es sich um einen Fehler handelt, welcher nicht allgemein zugeordnet werden kann. In den meisten Fehlern handelt es sich um erweiterte Validierungsfehler aus der Gruppe 03.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GLS Ship IT ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| CAP-GLS-03-E00050 || Ungültige GLS Contact ID || Die im HVS32 konfigurierte Contact ID fehlt oder ist ungültig&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hermes Shipping Interface (HSI) ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| CAP-HEH-03-E00050 || Ungültige Verpackungsart und Abmessungen. Mindestens eine Angabe ist erforderlich. || Hermes hat Verpackungen im Format XS, S, M, L, XL&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-HEH-03-E00051 || Ungültiges Geburtsdatum für Ident-Service || Für diese Sendung wurde ein Ident-Service gewählt. Das Geburtsdatum fehlt allerdings oder handelt sich nicht um ein gültiges Datum.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Schenker AT ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:140px&amp;quot; | Code !! style=&amp;quot;width:300px&amp;quot; | Text !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00050 || Fehler in Gefahrgutsatz. Ungültige UN Nummer. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die UN-Nummer&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00051 || Fehler in Gefahrgutsatz. Ungültige GG-Klasse. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die GG-Klasse.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00052 || Fehler in Gefahrgutsatz. Ungültiges GG-Gewicht. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie das GG-Gewicht.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00053 || Fehler in Gefahrgutsatz. Ungültige GG-Verpackung. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die GG-Verpackungsart.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00054 || Fehler in Gefahrgutsatz. Ungültige GG-Verpackungsgruppe. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die GG-Verpackungsgruppe.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00055 || Fehler in Gefahrgutsatz. Ungültige Bezeichnung. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die GG-Bezeichnung&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00056 || Fehler in Gefahrgutsatz. Keine Netto-Explosivmasse definiert für GG-Klasse 1. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie die Netto-Explosivmasse. Außerdem: Wurde mit Schenker AT abgesprochen, dass Sie Torpedos verschicken?&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| CAP-SHA-03-E00057 || Fehler in Gefahrgutsatz. Ungültiger Mengen-Typ. || Der Gefahrgutsatz ist unvollständig. Bitte prüfen Sie den Mengen-Typ (kg oder l)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin Codes ==&lt;br /&gt;
Jedes Plugin hat seine eigene Sub-Gruppe für einen Fehlercode. Nachfolgend aufgelistet sind alle Plugins.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Plugin&lt;br /&gt;
|-&lt;br /&gt;
| 000 || Unbekannt - Plugin konnte noch nicht ermittelt werden&lt;br /&gt;
|- &lt;br /&gt;
| AGX || AGX&lt;br /&gt;
|-&lt;br /&gt;
| AMZ || Amazon Merchant Fulfillment&lt;br /&gt;
|-&lt;br /&gt;
| AS2 || Amazon Shipping API v2&lt;br /&gt;
|-&lt;br /&gt;
| ASM || Amazon Selling Partner API - Merchant Fulfillment&lt;br /&gt;
|-&lt;br /&gt;
| ASV || Amazon Selling Partner API - Vendor Direct&lt;br /&gt;
|-&lt;br /&gt;
| DVF || AM.Exchange (DV-Freimachung)&lt;br /&gt;
|-&lt;br /&gt;
| ANL || Angel&lt;br /&gt;
|-&lt;br /&gt;
| APC || APC Overnight&lt;br /&gt;
|-&lt;br /&gt;
| ACO || Arco&lt;br /&gt;
|-&lt;br /&gt;
| ASE || Asendia&lt;br /&gt;
|-&lt;br /&gt;
| ATL || Atlas&lt;br /&gt;
|-&lt;br /&gt;
| CAL || Canis Lupus&lt;br /&gt;
|-&lt;br /&gt;
| CAR || Carousel&lt;br /&gt;
|-&lt;br /&gt;
| CEN || Centiro&lt;br /&gt;
|-&lt;br /&gt;
| CHR || Chronopost&lt;br /&gt;
|-&lt;br /&gt;
| CIP || Citipost&lt;br /&gt;
|-&lt;br /&gt;
| COU || Coureon&lt;br /&gt;
|-&lt;br /&gt;
| DSK || Danske&lt;br /&gt;
|-&lt;br /&gt;
| DCS || DCS&lt;br /&gt;
|-&lt;br /&gt;
| KUR || Der Kurier&lt;br /&gt;
|-&lt;br /&gt;
| DHP || DHL 24 PL&lt;br /&gt;
|-&lt;br /&gt;
| DEC || DHL eConnect&lt;br /&gt;
|-&lt;br /&gt;
| DHA || DHL ELP (Abholung)&lt;br /&gt;
|-&lt;br /&gt;
| DBB || DHL ES B2B&lt;br /&gt;
|-&lt;br /&gt;
| DHE || DHL ES B2C&lt;br /&gt;
|-&lt;br /&gt;
| DEL || DHL Express Routing Live&lt;br /&gt;
|-&lt;br /&gt;
| DET || DHL Express Routing Test&lt;br /&gt;
|-&lt;br /&gt;
| DHH || DHL Global Web Service (Ungarn)&lt;br /&gt;
|-&lt;br /&gt;
| DHN || DHL NL&lt;br /&gt;
|-&lt;br /&gt;
| DRL || DHL Retoure International (Legacy - veraltet)&lt;br /&gt;
|-&lt;br /&gt;
| DRI || DHL Retoure International&lt;br /&gt;
|-&lt;br /&gt;
| DHS || DHL SK (Slowakei)&lt;br /&gt;
|-&lt;br /&gt;
| DPD || DPD&lt;br /&gt;
|-&lt;br /&gt;
| DPA || DPD AT (Österreich)&lt;br /&gt;
|-&lt;br /&gt;
| DFR || DPD FR (Frankreich)&lt;br /&gt;
|-&lt;br /&gt;
| DPC || DPD HR (Kroatien)&lt;br /&gt;
|-&lt;br /&gt;
| DPH || DPD HU (Ungarn)&lt;br /&gt;
|-&lt;br /&gt;
| DPP || DPD DE Parcelshop Suche&lt;br /&gt;
|-&lt;br /&gt;
| DPL || DPD PL (Polen)&lt;br /&gt;
|-&lt;br /&gt;
| DPR || DPD RO (Rumänien)&lt;br /&gt;
|-&lt;br /&gt;
| DNL || DPD NL (Niederlande)&lt;br /&gt;
|-&lt;br /&gt;
| EPK || Europaket&lt;br /&gt;
|-&lt;br /&gt;
| FTD || Fedex Trade Documents&lt;br /&gt;
|-&lt;br /&gt;
| FXA || Fedex (Abholung)&lt;br /&gt;
|-&lt;br /&gt;
| FXP || Fedex PL (Polen)&lt;br /&gt;
|-&lt;br /&gt;
| FXS || Fedex Stratus REST API&lt;br /&gt;
|-&lt;br /&gt;
| FED || Fedex&lt;br /&gt;
|-&lt;br /&gt;
| FAC || Fiege Amazon Carma&lt;br /&gt;
|-&lt;br /&gt;
| GPP || General Purpose (konfigurierbar), auch G00 - G99&lt;br /&gt;
|-&lt;br /&gt;
| GEO || Geodis&lt;br /&gt;
|-&lt;br /&gt;
| GLO || Glovo&lt;br /&gt;
|-&lt;br /&gt;
| GLL || GLS CZ (Tschechien)&lt;br /&gt;
|-&lt;br /&gt;
| GLD || GLS DK (Dänemark)&lt;br /&gt;
|-&lt;br /&gt;
| GLE || GLS ES (Spanien)&lt;br /&gt;
|-&lt;br /&gt;
| GLF || GLS FR (Frankreich)&lt;br /&gt;
|-&lt;br /&gt;
| GLH || GLS HU (Ungarn)&lt;br /&gt;
|-&lt;br /&gt;
| GLI || GLS IT (Italien)&lt;br /&gt;
|-&lt;br /&gt;
| GLN || GLS NL (Niederlande)&lt;br /&gt;
|-&lt;br /&gt;
| GLP || GLS PL (Polen)&lt;br /&gt;
|-&lt;br /&gt;
| GPS || GLS Parcel Shop (GLS DE Parcelshop Suche)&lt;br /&gt;
|-&lt;br /&gt;
| GSA || GLS AT / Ship IT (Österreich)&lt;br /&gt;
|-&lt;br /&gt;
| GSD || GLS DK / Ship IT (Dänemark)&lt;br /&gt;
|-&lt;br /&gt;
| GSF || GLS FR / Ship IT (Frankreich)&lt;br /&gt;
|-&lt;br /&gt;
| GSP || GLS PL / Ship IT (Polen)&lt;br /&gt;
|-&lt;br /&gt;
| GLS || GLS DE / Ship IT (Deutschland)&lt;br /&gt;
|-&lt;br /&gt;
| GLK || GLS SK (Slowakei)&lt;br /&gt;
|-&lt;br /&gt;
| GTT || GLS DE Track &amp;amp; Trace&lt;br /&gt;
|-&lt;br /&gt;
| HMP || Hellmann PL (Polen)&lt;br /&gt;
|-&lt;br /&gt;
| HBG || Hermes Border Guru&lt;br /&gt;
|-&lt;br /&gt;
| HES || Hermes Einrichtungs Service (HES)&lt;br /&gt;
|-&lt;br /&gt;
| HEH || Hermes Shipping Interface (HSI)&lt;br /&gt;
|-&lt;br /&gt;
| HRB || Hornbach&lt;br /&gt;
|-&lt;br /&gt;
| ICS || ICS&lt;br /&gt;
|-&lt;br /&gt;
| INP || Inpost24&lt;br /&gt;
|-&lt;br /&gt;
| DIM || Internetmarke (Deutsche Post)&lt;br /&gt;
|-&lt;br /&gt;
| IZP || Infens Zustellprofi&lt;br /&gt;
|-&lt;br /&gt;
| KOV || Kommt Overnight&lt;br /&gt;
|-&lt;br /&gt;
| LFG || Liefergrün&lt;br /&gt;
|-&lt;br /&gt;
| LGX || Log X Star&lt;br /&gt;
|-&lt;br /&gt;
| MON || Mondial Relay&lt;br /&gt;
|-&lt;br /&gt;
| PPL || PPL&lt;br /&gt;
|-&lt;br /&gt;
| NCX || Nacex&lt;br /&gt;
|-&lt;br /&gt;
| OMS || Omest&lt;br /&gt;
|-&lt;br /&gt;
| ONT || Ontime&lt;br /&gt;
|-&lt;br /&gt;
| PLW || Palletways&lt;br /&gt;
|-&lt;br /&gt;
| PIL || Pilot&lt;br /&gt;
|-&lt;br /&gt;
| PAT || Post AT (Österreich)&lt;br /&gt;
|-&lt;br /&gt;
| PHR || Posti HR (Kroatien)&lt;br /&gt;
|-&lt;br /&gt;
| PFI || Posti FI (Finnland)&lt;br /&gt;
|-&lt;br /&gt;
| PON || Post Nord&lt;br /&gt;
|-&lt;br /&gt;
| PSI || Post SI (Slovenien)&lt;br /&gt;
|-&lt;br /&gt;
| PSK || Post SK (Slovakei)&lt;br /&gt;
|-&lt;br /&gt;
| PPL || PPL&lt;br /&gt;
|-&lt;br /&gt;
| SHA || Schenker AT (Österreich)&lt;br /&gt;
|-&lt;br /&gt;
| SHD || Schenker&lt;br /&gt;
|-&lt;br /&gt;
| SHS || Schenker SE (Schweden)&lt;br /&gt;
|-&lt;br /&gt;
| SND || Sending&lt;br /&gt;
|-&lt;br /&gt;
| SES || Seven Senders (7senders)&lt;br /&gt;
|-&lt;br /&gt;
| SPR || SPRING&lt;br /&gt;
|-&lt;br /&gt;
| TDN || TDN&lt;br /&gt;
|-&lt;br /&gt;
| TRM || Tiramizoo&lt;br /&gt;
|-&lt;br /&gt;
| TMP || TMParcel&lt;br /&gt;
|-&lt;br /&gt;
| TNI || TNT IT (Italien)&lt;br /&gt;
|-&lt;br /&gt;
| TNF || TNT FR (Frankreich)&lt;br /&gt;
|-&lt;br /&gt;
| TNN || TNT Post NL (Niederlande)&lt;br /&gt;
|-&lt;br /&gt;
| TBN || TNT NL - Retoure Belgien&lt;br /&gt;
|-&lt;br /&gt;
| TNT || TNT (Deutschland)&lt;br /&gt;
|-&lt;br /&gt;
| TOH || TOF HU (Ungarn)&lt;br /&gt;
|-&lt;br /&gt;
| TPN || TPN&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| UPG || UPS GG (Gefahrgut PreAvis)&lt;br /&gt;
|-&lt;br /&gt;
| UPP || UPS Paperless Document&lt;br /&gt;
|-&lt;br /&gt;
| UPA || UPS Pickup (Abholung)&lt;br /&gt;
|-&lt;br /&gt;
| UPA || UPS Pickup (Abholung)&lt;br /&gt;
|-&lt;br /&gt;
| UPT || UPS Tarifierung&lt;br /&gt;
|-&lt;br /&gt;
| VNP || Venipak&lt;br /&gt;
|-&lt;br /&gt;
| WYF || Wayfair&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6266</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6266"/>
		<updated>2026-03-23T12:41:27Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;As of DGS version 3.8.41, the certificate can also be imported into DGS as a PFX file – the certificate and the private key are extracted from the PFX in the process. Please make sure that, if present, the certificate chain is fully included in the certificate (or PFX) (if required by the client).&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.44&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To request the initial tokens we offer multiple options.&lt;br /&gt;
&lt;br /&gt;
You can either request the tokens via Authorization Basic, in which the ClientID + ClientSecret are exposed in the HTTP header.&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another option is to request the tokens via JWT. In this option the ClientID is within the payload and the JWT is signed with the ClientSecret. This option offers additional securities, since the ClientSecret itself is never exposed.&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div&amp;gt;&amp;#039;&amp;#039;&amp;#039;Example of token request (generating access and refresh tokens with JWT)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request via JWT (jwt-bearer) the ClientID is within the payload as &amp;#039;&amp;#039;sub&amp;#039;&amp;#039; and signed with ClientSecret. The JWT must be transmitted in the HTTP header &amp;#039;&amp;#039;client_assertion&amp;#039;&amp;#039;. To use JWT authentification the HTTP header &amp;#039;&amp;#039;client_assertion_type&amp;#039;&amp;#039; with value &amp;#039;&amp;#039;jwt-bearer&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&lt;br /&gt;
In this example following &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; - &amp;#039;&amp;#039;huF3sPp5g5zUXP70bQ3O&amp;#039;&amp;#039; - was used.&lt;br /&gt;
&lt;br /&gt;
Following &amp;#039;&amp;#039;&amp;#039;ClientSecret&amp;#039;&amp;#039;&amp;#039; was used - &amp;#039;&amp;#039;yX2[K2DC*CjvUI3Us!eCrM@B%5OHJ@U5JCw+)Jv1b+3@1f[?YOw]mxmc(Aes)K5N&amp;#039;&amp;#039;&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
client_assertion_type: jwt-bearer&lt;br /&gt;
client_assertion: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJodUYzc1BwNWc1elVYUDcwYlEzTyIsIm5hbWUiOiJIZWlkbGVyIFN0cmljaGNvZGUgR21iSCBURVNUIiwiaWF0IjoxODE2MjM5MDIyfQ.xKwD4wnQud55LVqvs47Sy0jKhpbxb0JVZtgMWWbjNKo&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Managing Client Credentials in the DGS==&lt;br /&gt;
The client credentials are managed in the DataGatewayServer. You can create new credentials or delete existing ones.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this, start the Credentials Configurator (.exe) located in the installation directory of the DataGatewayServer.&lt;br /&gt;
===Config===&lt;br /&gt;
[[File:Authorization Credentials 001.png|thumb|right|Credentials Configurator - config]]&lt;br /&gt;
On this screen, general configurations can be made.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;If this option is active, the number of invalid authentication attempts will be counted. After &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; within &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039;, all credentials will be locked.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;If this option is active when using OAuth2.0 CC, a &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; will be triggered if a REFRESH TOKEN is reused multiple times. This action deactivates all ACCESS and REFRESH TOKENS, requiring new tokens to be requested via client credentials. Additionally, the DGS Configurator can be configured to send an email notification in the event of a CODE RED.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock Credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;With this button, all credentials can be locked or unlocked. For instance, if all client credentials were locked due to the &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; option, they can be unlocked here. This action takes effect immediately without needing to save.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;This button persistently saves the settings and credentials. The options and credentials only become active after saving. A DGS restart is not required.&lt;br /&gt;
===Managing Credentials===&lt;br /&gt;
[[File:Authorization Credentials 002.png|thumb|right|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[File:Authorization Credentials 003.png|thumb|right|Enter Username / ClientID]]&lt;br /&gt;
[[File:Authorization Credentials 004.png|thumb|right|Show Credentials Dialog]]&lt;br /&gt;
To manage your credentials, select the appropriate tab for the authentication method configured in the DGS (e.g., OAuth2.0 CC).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;create new credentials. Note that the password or client secret will only be displayed once in a dialog. Be sure to copy it to a secure location and ensure no unauthorized persons have access to it.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;assign a new password or client secret. As with the add function, the password or client secret will only be displayed once in a dialog.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;remove the selected credentials.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6265</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6265"/>
		<updated>2026-03-23T12:38:21Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Interfaces:_Security_Levels_and_Authentication]]&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&lt;br /&gt;
&lt;br /&gt;
Für die Verschlüsselung wird jeweils ein Zertifikat mit zugehörigem Private Key benötigt. Die folgenden Zertifikatsformate werden unterstützt:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zertifikate:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der oder *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, oder *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ab DGS Version 3.8.41, kann das Zertifikat auch als PFX ins DGS importiert werden - das Zertifikat und der Private-Key werden dabei aus dem PFX extrahiert. Bitte stellen Sie sicher, dass falls vorhanden die Zertifikatskette vollständig im Zertifikat (bzw. PFX) hinterlegt ist (wenn der Client dies erfordert)&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&amp;lt;br&amp;gt;Es wird &amp;#039;&amp;#039;&amp;#039;mindestens&amp;#039;&amp;#039;&amp;#039; die DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.44&amp;#039;&amp;#039;&amp;#039; benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Bei der initialen Tokenanfrage stehen verschiedene zwei Möglichkeiten zum Abrufen bereit.&lt;br /&gt;
&lt;br /&gt;
Zum einen kann man die Token über die Authorization Basic anfragen, bei welchem die ClientID + ClientSecret im HTTP-Header mitgegeben werden.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;Eine weitere Variante die Token abzurufen ist über einen JWT. Bei dieser Methode wird die ClientID im Payload vom JWT übermittelt und das JWT selbst mit dem ClientSecret signiert. Diese Möglichkeit bietet eine zusätzliche Sicherheit, da dass ClientSecret selbst nie exposed wird.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken über JWT generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage &amp;#039;&amp;#039;&amp;#039;JWT (jwt-bearer)&amp;#039;&amp;#039;&amp;#039; muss die Client-ID und das Client-Secret in einem JWT übermittelt werden. Dabei wird die &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; im JWT Payload als &amp;quot;sub&amp;quot; übermittelt und mit dem ClientSecret signiert. Das JWT wird Im HTTP-Header als &amp;#039;&amp;#039;client_assertion&amp;#039;&amp;#039; übermittelt. Die Anfrage über das JWT erfolgt über den HTTP-Header &amp;#039;&amp;#039;client_assertion_type&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&lt;br /&gt;
In diesem Beispiel wurde die &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; - &amp;#039;&amp;#039;huF3sPp5g5zUXP70bQ3O&amp;#039;&amp;#039; - verwendet.&lt;br /&gt;
&lt;br /&gt;
Das &amp;#039;&amp;#039;&amp;#039;ClientSecret&amp;#039;&amp;#039;&amp;#039; lautet - &amp;#039;&amp;#039;yX2[K2DC*CjvUI3Us!eCrM@B%5OHJ@U5JCw+)Jv1b+3@1f[?YOw]mxmc(Aes)K5N&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
client_assertion_type: jwt-bearer&lt;br /&gt;
client_assertion: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJodUYzc1BwNWc1elVYUDcwYlEzTyIsIm5hbWUiOiJIZWlkbGVyIFN0cmljaGNvZGUgR21iSCBURVNUIiwiaWF0IjoxODE2MjM5MDIyfQ.xKwD4wnQud55LVqvs47Sy0jKhpbxb0JVZtgMWWbjNKo&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Client Credentials im DGS verwalten==&lt;br /&gt;
Die Client Credentials werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&amp;lt;br&amp;gt;&lt;br /&gt;
Dazu muss im Installationsverzeichnis des DataGatewayServer der Credentials-Configurator(.exe) gestartet werden.&lt;br /&gt;
===Config===&lt;br /&gt;
[[Datei:Authorization Credentials 001.png|mini|rechts|Credentials Configurator - config]]&lt;br /&gt;
Hier können allgemeine Konfigurationen vorgenommen werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option aktiv ist, wird die Anzahl der ungültigen Authentifizierungen gezählt und nach &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; innerhalb von &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039; werden alle Credentials gesperrt&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option bei der Nutzung von OAuth2.0 CC aktiv ist, wird bei mehrfachen verwenden eines REFRESH TOKENS ein &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; ausgelöst. Hierbei werden alle ACCESS und REFRESH TOKENS deaktiviert und es müssen neue Tokens via Client Credentials angefordert werden. Zusätzlich kann im DGS Konfigurator das Versenden einer E-Mail bei einem CODE RED konfiguriert werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Über diesen Button können alle Credentials gesperrt oder entsperrt werden. Wenn z.b. durch die Option &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; alle Client Credentials gesperrt wurden, können diese somit wieder entsperrt werden. Diese Option greift sofort, ohne speichern.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;Mit diesem Button werden die Einstellungen und Credentials persistent gespeichert. Erst nach dem Speichern werden die Optionen und Credentials aktiv. Ein DGS Neustart ist nicht notwendig.&lt;br /&gt;
===Credentials verwalten===&lt;br /&gt;
[[Datei:Authorization Credentials 002.png|mini|rechts|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[Datei:Authorization Credentials 003.png|mini|rechts|Enter Username / ClientID]]&lt;br /&gt;
[[Datei:Authorization Credentials 004.png|mini|rechts|Show Credentials Dialog]]&lt;br /&gt;
Um Ihre Credentials zu verwalten, wählen Sie den passenden Reiter zu Ihrer im DGS konfigurierten Authentifizierungs-Methode (z.B. OAuth2.0 CC)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie neue Credentials anlegen. Beachten Sie, dass das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt wird. Kopieren Sie es daher in einen sicheren Platz und stellen Sie sicher, dass keine unautorisierten Personen darauf Zugriff haben.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; bzw. &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie ein neues Passwort bzw. Client Secret vergeben. Wie bei der add Funktion, wird das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie die die ausgewählten Credentials entfernen.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_Automatik-Polling_Funktionen&amp;diff=6225</id>
		<title>HVS32 Automatik-Polling Funktionen</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_Automatik-Polling_Funktionen&amp;diff=6225"/>
		<updated>2025-12-05T14:42:28Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_automatic_polling_functions]]&lt;br /&gt;
= Datentypen =&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Integer&amp;#039;&amp;#039;&amp;#039; - Zahl mit ausschließlich numerischen Zeichen (0-9).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Decimal&amp;#039;&amp;#039;&amp;#039; - Zahl mit Nachkommastellen&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;String&amp;#039;&amp;#039;&amp;#039; - Beliebige Zeichen aus dem Zeichensatz ISO-8859-1. Maximale Länge darf nicht überschritten werden.&amp;lt;br&amp;gt;&lt;br /&gt;
= Zusätzliche Datentypen =&lt;br /&gt;
Zusätzliche Datentypen, welche in der Beschreibung vorkommen, stehen in einer 1:n Relation zu den Packstücken.&lt;br /&gt;
Bitte entnehmen Sie der jeweiligen Schnittstellen-Dokumentation des entsprechenden Plugins (File, JDBC, SAP, etc.), wie diese Relation realisiert werden muss.&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- ENDE ÜBERSICHT UNTERFUNKTIONEN ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- artikelDaten ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
== ArtikelDaten ==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
|Satz-Kennung&lt;br /&gt;
|[[#Datentypen|String]]&lt;br /&gt;
|3&lt;br /&gt;
| -&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Wird nur bei Datei Verabeitung benötigt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Satzkennung in der Polling Datei: &amp;quot;ART&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;--- ARTIKELDATEN-TEIL ---&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANZAHLBUEGEL || [[#Datentypen|Integer]] || - || - || Nur für Hängeversand: Anzahl der Bügel auf welche die Artikelgruppe aufgeteilt ist&lt;br /&gt;
|-&lt;br /&gt;
| ANZAHLPOSETIKETTEN || [[#Datentypen|Integer]] || - || - || Anzahl Artikeletiketten, welche gedruckt werden sollen&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELBTNNR || [[#Datentypen|String]] || 25 || - || BTN Nummer / Zolltarifnummer&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELEAN || [[#Datentypen|String]] || 20 || - || EAN Nummer&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELEINHEIT || [[#Datentypen|String]] || 10 || - || Einheit der Artikelmenge&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELGEWICHT || [[#Datentypen|Decimal]] || 9 || 3 || Gewicht des Artikels in kg&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELGRUPPE || [[#Datentypen|String]] || 50 || - || Artikelgruppe&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELMENGE || [[#Datentypen|Decimal]] || 9 || 3 || Menge des Artikels&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELSERVICES || [[#Datentypen|String]] || 100 || - || Pipe getrennte Services für diesen Artikel&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELSOLLMENGE || [[#Datentypen|Decimal]] || 9 || 3 || -&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELTEXT1 || [[#Datentypen|String]] || 100 || - || Artikelbezeichnung&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELTEXT2 || [[#Datentypen|String]] || 100 || - || Artikelbezeichnung&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELTEXT3 || [[#Datentypen|String]] || 100 || - || Artikelbezeichnung&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELTEXT4 || [[#Datentypen|String]] || 100 || - || Artikelbezeichnung&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELVOLUMEN || [[#Datentypen|Decimal]] || 9 || 3 || Volumen des Artikels&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELWAEHRUNG || [[#Datentypen|String]] || 3 || - || Währung in welcher der Wert des Artikels angegeben wird&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELWERT || [[#Datentypen|Decimal]] || 18 || 2 || Wert des Artikels&lt;br /&gt;
|-&lt;br /&gt;
| CHARGEFLAG || [[#Datentypen|String]] || 1 || - || &lt;br /&gt;
|-&lt;br /&gt;
| KUNDENARTIKELNR || [[#Datentypen|String]] || 50 || - || Artikelnummer&lt;br /&gt;
|-&lt;br /&gt;
| KUNDENBESTELLNR || [[#Datentypen|String]] || 50 || - || Bestellnummer&lt;br /&gt;
|-&lt;br /&gt;
| POSAUFTRAGNR || [[#Datentypen|String]] || 50 || - || Auftragsnummer&lt;br /&gt;
|-&lt;br /&gt;
| POSLIEFERNR || [[#Datentypen|String]] || 40 || - || Lieferscheinnummer&lt;br /&gt;
|-&lt;br /&gt;
| POSITIONNR || [[#Datentypen|String]] || 50 || - || Laufende Nummer innerhalb des Packstücks&lt;br /&gt;
|-&lt;br /&gt;
| SERIENNR || [[#Datentypen|String]] || 30 || - || Seriennummer&lt;br /&gt;
|-&lt;br /&gt;
| URSPRUNGLAND || [[HVS32 Automatik-Polling Funktionen#Datentypen|String]] || 2 || - || Ursprungsland des Artikels&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- ENDE artikelDaten ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- gefahrgut ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gefahrgut ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In der Gefahrgut Abwicklung bieten wir zwei Möglichkeiten der Abwicklung an. Zum einen können die kompletten Gefahrgutdaten ans HVS32 übermittelt werden [[HVS32 Automatik-Polling Funktionen#Gefahrgut (aus den Positionsdaten)|(aus den Positionsdaten)]].&lt;br /&gt;
&lt;br /&gt;
Zum anderen gibt es die Möglichkeit, die Gefahrgutdaten ins HVS32 zu importieren und dort zu pflegen (siehe [[Verarbeitungsbeschreibung: Gefahrgut|Gefahrgutstamm]]). In diesem Fall müssen nicht alle Gefahrgutdaten ans HVS32 übermittelt werden, sondern werden aus dem im HVS32 hinterlegten Stamm ausgelesen. [[HVS32 Automatik-Polling Funktionen#Gefahrgut (über Gefahrgutstamm im HVS32)|(über Gefahrgutstamm im HVS32)]]&amp;lt;!--------------------------------------------------------------------------------- gefahrgut positionsdaten ---------------------------------------------------------------------------------&amp;gt;&lt;br /&gt;
===Gefahrgut (aus den Positionsdaten)===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
|Satz-Kennung&lt;br /&gt;
|[[#Datentypen|String]]&lt;br /&gt;
|3&lt;br /&gt;
| -&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Wird nur bei Datei Verabeitung benötigt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Satzkennung in der Polling Datei: &amp;quot;GEF&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;--- GEFAHRGUTDATEN-TEIL ---&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTBEFOERDKAT&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|Integer]] || 1 || - || Beförderungskategorie, Pflicht (siehe ADR-Tabelle Spalte (15)), kann 0-4 sein. Achtung! Muss unbedingt korrekt sein.&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTBEGRENZTEMENGE || [[#Datentypen|String]] || 1 || - || T wenn der Stoff mit Status LQ / Begrenzte Menge nach ADR 3.4 verschickt wird, ansonsten F, Pflicht&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTBEZEICHNUNG&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|String]] || 110 || - || Pflicht (siehe ADR-Tabelle Spalte (2))&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTBUCHST640 || [[#Datentypen|String]] || 1 || - || Buchstabe für Sondervorschrift 640, bedingte Pflicht bei Stoffen, bei denen die Sondervorschrift 640 gilt (siehe ADR-Tabelle Spalte (6))&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTFFCODE || [[#Datentypen|String]] || &amp;lt;!-- MAXLÄNGE --&amp;gt; || &amp;lt;!-- DEZ --&amp;gt; || &amp;lt;!-- BELEGUNG --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTFAKTOR || [[#Datentypen|Integer]] || 3 || - || Bewertungsfaktor für Punktesummation auf dem Beförderungspapier,  (kann 0, 1, 3, 50 oder 999 sein), eigentlich Pflicht, kann aber eindeutig aus der Beförderungskategorie geschlossen werden, daher muss es nicht unbedingt belegt sein&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTFREIGESTMENGE || [[#Datentypen|String]] || 1 || - || T wenn der Stoff mit Status EQ / Excepted Quantities nach ADR 3.5 verschickt wird, ansonsten F, Pflicht&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTID || [[#Datentypen|String]] || 20 || - || Eindeutige Suchnummer für Gefahrgut-Stammdaten&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTKCODE || [[#Datentypen|String]] || 10 || - || Klassifizierungscode, Pflicht (siehe ADR-Tabelle Spalte (3b))&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTKLASSE&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|String]] || 100 || - || Pflicht (siehe ADR-Tabelle Spalte (3a))&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTMENGE&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|Decimal]] || 8 || 3 || Stoff-Menge an Gefahrgut, die ADR-technisch zu deklarieren ist ( in Litern bei Flüssigkeiten und verdichteten Gasen, sonst in kg, bei LQ-Gefahrgut immer kg )&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTMENGENEINHEIT&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|String]] || 2 || - || Mengeneinheit zur Stoff-Menge. ‚1‘ oder ‚l‘: Liter ; ‚0‘ oder ‚kg‘ oder leer: kg&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTNEBENGEFAHR || [[#Datentypen|String]] || 10 || - || bedingte Pflicht bei Stoffen, bei denen neben der Hauptgefahr-Klasse/Zettelnummer noch Nebengefahr-Zettelnummern vorhanden sind (siehe ADR-Tabelle Spalte (5), wenn dort z.B. 3+6.1+8 eingetragen ist, sind 6.1 und 8 die Nebengefahr-Zettelnummern und als (6.1)(8) im Feld Nebengefahr zu übermitteln )&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTNETTOEXPLMASSE || [[#Datentypen|Decimal]] || 8 || 3 || Netto-Explosivmasse in kg, nur bei Gefahrgütern der Klasse 1&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTPOSITIONNR || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTTECHBENENNUNG || [[#Datentypen|String]] || 150 || - || bedingt Pflicht bei N.A.G. Gefahrgut (d.h. wenn die Bezeichnung mit N.A.G. endet)&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTTUNNELBCODE || [[#Datentypen|String]] || 10 || - || Tunnelbeschränkungscode, Pflicht (siehe ADR-Tabelle Spalte (15))&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTUNNR&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|String]] || 10 || - || Pflicht (siehe ADR-Tabelle Spalte (1))&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTUMWELTGEF || [[#Datentypen|String]] || 1 || - || T wenn Stoff umweltgefährdend ist , ansonsten F, Pflicht bei umweltgefährdenden Stoffen&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTVPG || [[#Datentypen|String]] || 3 || - || Verpackungsgruppe, bedingt Pflicht bei den Stoffen, bei denen diese in der ADR-Tabelle belegt ist, kann I,II oder III sein oder gar nicht belegt (letzteres z.B. bei Klasse 2)) (siehe ADR-Tabelle Spalte (4))&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTVERPANZAHL&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|Integer]] || 4 || - || Anzahl der Einheiten, in denen das Gefahrgut verpackt ist (in Zusammenhang mit dem nächsten Feld GefahrgutVerpackungsart)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTVERPACKUNGSART&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|String]] || 5 || - || ADR-Code der Verpackungsart, z.B. 4G für Kiste (Pappe), Pflicht, siehe separate Doc f. Verpackungscodes&lt;br /&gt;
|}&lt;br /&gt;
===Gefahrgut (über [[Verarbeitungsbeschreibung: Gefahrgut|Gefahrgutstamm im HVS32]])===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Feldname !!Typ!!Max Länge!! Dezimalstellen!!Belegung&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;GefahrgutID&amp;#039;&amp;#039;&amp;#039;||[[HVS32 Automatik-Polling Funktionen#Datentypen|String]]||20||- ||Eindeutige Suchnummer für Gefahrgut-Stammdaten&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;GefahrgutMenge&amp;#039;&amp;#039;&amp;#039;||[[HVS32 Automatik-Polling Funktionen#Datentypen|Decimal]]||8||3||-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;GefahrgutVerpAnzahl&amp;#039;&amp;#039;&amp;#039;||[[HVS32 Automatik-Polling Funktionen#Datentypen|Integer]]||-||-||-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;GefahrgutMengenEinheit&amp;#039;&amp;#039;&amp;#039;||[[HVS32 Automatik-Polling Funktionen#Datentypen|String]]||2||- ||&amp;#039;0&amp;#039; bzw Blank: Kilogramm; &amp;#039;1&amp;#039;: Liter&lt;br /&gt;
|-&lt;br /&gt;
|GefahrgutNettoExplMasse ||[[HVS32 Automatik-Polling Funktionen#Datentypen|Decimal]]||8||3 ||Nur bei Klasse 1, dann aber Pflicht&lt;br /&gt;
|}&amp;lt;!-- ------------------------------------------------------------------------------- ENDE gefahrgut ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Packstück-Verarbeitung (VersandDatenAnfrage) =&lt;br /&gt;
Die Gatewayfunktion VersandDatenAnfrage wird vom Data-Gateway-Server im Automatik-Polling Modus an das HVS32 gesendet, um dort ein Etikett für ein Packstück zu erzeugen und verbuchen.&lt;br /&gt;
Ein Etikett wird für alle weiteren Funktionen wir Storno, Verladefreigabe, etc. anhand der hostseitigen Packstück-ID identifiziert. Diese wird im Feld PackstueckID übergeben und muss dementsprechend innerhalb des Versandsystems eindeutig sein.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Durch eine zusätzliche Konfiguration im HVS32 kann die VersandDatenAnfrage auch dazu verwendet werden, um einen Nachdruck anzustoßen. Dabei muss bei der erneuten Anfrage die selbe PackstueckID verwendet werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| ANSPRECHPARTNER || [[#Datentypen|String]] || 50 || - || Empfänger Ansprechpartner&lt;br /&gt;
|-&lt;br /&gt;
| ANZAHLARTIKEL || [[#Datentypen|Integer]] || 6 || - || Anzahl Artikel (Druck auf Etikett)&lt;br /&gt;
|-&lt;br /&gt;
| [[#ArtikelDaten|ARTIKELDATEN]] || [[#Datentypen|Sequence]] &amp;#039;&amp;#039;&amp;#039;[[#ArtikelDaten|&amp;lt;ArtikelDaten&amp;gt;]]&amp;#039;&amp;#039;&amp;#039; || - || - || Eine Liste der [[#ArtikelDaten|Packstück-Artikel]] vom Typ &amp;#039;&amp;#039;&amp;#039;[[#ArtikelDaten|ArtikelDaten]]&amp;#039;&amp;#039;&amp;#039; (1:n)&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGNR || [[#Datentypen|String]] || 20 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;AUFTRAGGEBERID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Mandantenkennung aus dem HVS32&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS1 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS2 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ1 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 1&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ2 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 2&lt;br /&gt;
|-&lt;br /&gt;
| BARCODEID || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BARCODETEXT || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BARCODETYP || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BESTELLNR || [[#Datentypen|String]] || 20 || - || Metro-Bestellnr (Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKERNAME || [[#Datentypen|String]] || 30 || - || Name eines Ausgabekanals (Drucker) im HVS32 über den das Etikett gedruckt wird. (Benötigt Druckerspooler Erweiterungsmodul)&lt;br /&gt;
|-&lt;br /&gt;
| EMAIL || [[#Datentypen|String]] || 100 || - || E-Mail Adresse des Empfängers (z.B.: für die Automatische E-Mail Avisierung)&lt;br /&gt;
|-&lt;br /&gt;
| EMPFMOBILFUNKNR || [[#Datentypen|String]] || 20 || - || Mobilfunknummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FAXNR || [[#Datentypen|String]] || 20 || - || Faxnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FLEXZUSTELLUNGEMAILADRESSE || [[#Datentypen|String]] || 80 || - || Flex-Zustellung Emailadresse&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTBRIEF || [[#Datentypen|String]] || 20 || - || Frachtbrief Nummer falls Frachtbrief durch Vorsystem gedruckt werden soll&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTFUEHRERKDNR || [[#Datentypen|String]] || 10 || - || Kundennummer des Frachtzahlers beim Frachtführer&lt;br /&gt;
|-&lt;br /&gt;
| FRANKATURKENNUNG || [[#Datentypen|String]] || 10 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| [[#Gefahrgut|GEFAHRGUT]] || [[#Datentypen|Sequence]] &amp;#039;&amp;#039;&amp;#039;[[#Gefahrgut|&amp;lt;Gefahrgut&amp;gt;]]&amp;#039;&amp;#039;&amp;#039; || - || - || Eine Liste der [[#Gefahrgut|Gefahrgüter]] vom Typ &amp;#039;&amp;#039;&amp;#039;[[#Gefahrgut|Gefahrgut]]&amp;#039;&amp;#039;&amp;#039; (1:n)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEWICHT&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|Decimal]] || 8 || 3 || Bruttogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| HOSTTRACKINGNR || [[#Datentypen|String]] || 35 || - || Paketnummer aus dem Hostsystem&lt;br /&gt;
|-&lt;br /&gt;
| ILNNR || [[#Datentypen|String]] || 20 || - || ILN des Empfängers (Pflicht bei Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| KOSTENSTELLE || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| KUNDENNR || [[#Datentypen|String]] || 20 || - || Kundennummer des Empfängers beim Versender&lt;br /&gt;
|-&lt;br /&gt;
| LAGERKENNZEICHEN || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| LETZTESPACKSTUECK || [[#Datentypen|String]] || 1 || - || T/F: T=letztes Packstüeck der Sendung (wird bei Hängeversand zum Drucken der Sendungs-Hängekarte benötigt)&lt;br /&gt;
|-&lt;br /&gt;
| LIEFERANTENID || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;LIEFERSCHEINNR&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 40 || - || Wird im HVS32 als Such-Nummer verwendet&lt;br /&gt;
|-&lt;br /&gt;
| NACHNAHME || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| NETTOGEWICHT || [[#Datentypen|Decimal]] || 8 || 3 || Nettogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| NEUTBIC || [[#Datentypen|String]] || 11 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTBANKBEZEICHNUNG || [[#Datentypen|String]] || 40 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTIBAN || [[#Datentypen|String]] || 31 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTKONTOINHABER || [[#Datentypen|String]] || 40 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERLKZ || [[#Datentypen|String]] || 3 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME1 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME2 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME3 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERORT || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERPLZ || [[#Datentypen|String]] || 10 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERSTRASSE || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NNVERMERK || [[#Datentypen|String]] || 1 || - || &amp;#039;B&amp;#039;: Bar / &amp;#039;V&amp;#039;: Verrechnungsscheck&lt;br /&gt;
|-&lt;br /&gt;
| NNVERWENDUNG || [[#Datentypen|String]] || 30 || - || Nachnahme Verwendungszweck&lt;br /&gt;
|-&lt;br /&gt;
| NNWAEHRUNG || [[#Datentypen|String]] || 3 || - || Nachnahme - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTKGES&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|Integer]] || - || - || Gesamt-Anzahl Colli der Sendung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTKNR&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|Integer]] || - || - || Laufende Nr pro Sendung&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeiten soll.&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKBREITE || [[#Datentypen|Integer]] || - || - || Breite in cm&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKHOEHE || [[#Datentypen|Integer]] || - || - || Höhe in cm&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTUECKID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 20 || - || Eindeutige Nummer für das Paket im Vorsystem. Wird als eindeutige Paketreferenz benötigt um das Etikett später zu stornieren oder zu Verladen.&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKLAENGE || [[#Datentypen|Integer]] || - || - || Länge in cm&lt;br /&gt;
|-&lt;br /&gt;
| PAPERLESSINVOICE || [[#Datentypen|String]] || 1 || - || Nur im UPS PaperlessInvoice Fall (T=PaperlessInvoice / F=nicht PaperlessInvoice)&lt;br /&gt;
|-&lt;br /&gt;
| POSTLEITCODE || [[#Datentypen|String]] || 15 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| POSTZIELFRACHTZENT || [[#Datentypen|String]] || 5 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFLKZ || [[#Datentypen|String]] || 5 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME1 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME2 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME3 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFORT || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFPLZ || [[#Datentypen|String]] || 10 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFSTRASSE || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSNR || [[#Datentypen|String]] || 20 || - || Rechnungsnummer&lt;br /&gt;
|-&lt;br /&gt;
| SENDUNGSINHALT || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| SONDERDIENSTE || [[#Datentypen|String]] || 30 || - || Versandart-spezifisch belegt&lt;br /&gt;
|-&lt;br /&gt;
| SPERRFLAG || [[#Datentypen|String]] || 1 || - || T/F: T=Sperren, sonst nicht sperren&lt;br /&gt;
|-&lt;br /&gt;
| TELEFONNR || [[#Datentypen|String]] || 20 || - || Telefonnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| TERMINART || [[#Datentypen|String]] || 1 || - || &amp;#039;A&amp;#039; = ab diesem Tag liefern&lt;br /&gt;
&amp;#039;B&amp;#039; = bis zu diesem Tag liefern&lt;br /&gt;
&lt;br /&gt;
&amp;#039;F&amp;#039; = an diesem Tag liefern&lt;br /&gt;
|-&lt;br /&gt;
| TERMINDATUM || [[#Datentypen|String]] || 10 || - || TT.MM.JJJJ&lt;br /&gt;
|-&lt;br /&gt;
| TERMINZEIT || [[#Datentypen|Calendar]] || 5 || - || HH:MM&lt;br /&gt;
|-&lt;br /&gt;
| USTIDNR || [[#Datentypen|String]] || 20 || - || UmsatzsteuerNr des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| VERPACKUNGSART || [[#Datentypen|String]] || 6 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;VERSANDARTID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Versandartkennung aus dem HVS32&lt;br /&gt;
|-&lt;br /&gt;
| VERSICHERUNGSWERT || [[#Datentypen|Decimal]] || 18 || 2 || Höhe Versicherungswert&lt;br /&gt;
|-&lt;br /&gt;
| VORPACKDATUM || [[#Datentypen|String]] || 10 || - || TT.MM.JJJJ&lt;br /&gt;
|-&lt;br /&gt;
| VWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Versicherungswert - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| WARENWERT || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Wechselbrücke, die diesem Packstück zugewiesen wird&lt;br /&gt;
|-&lt;br /&gt;
| WWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Warenwert - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| ZAHLUNGSBEDINGUNG || [[#Datentypen|String]] || 10 || - || &amp;#039;S&amp;#039; = Sender, &amp;#039;R&amp;#039; = Empfänger&lt;br /&gt;
|-&lt;br /&gt;
| ZBZOLL || [[#Datentypen|String]] || 1 || - || Zahlungsbedingung für Zoll Steuern &amp;#039;S&amp;#039; = Sender, &amp;#039;R&amp;#039; = Empfänger&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRBAHNHOF || [[#Datentypen|String]] || 30 || - || PLZ und Ort&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRLKZ&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 5 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRNAME1&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME2 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME3 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME4 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRORT&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRPLZ&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRREGION || [[#Datentypen|String]] || 20 || - || Staat/Provinz (z.B.: für Sendungen in die USA wichtig)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRSTRASSE&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung|&lt;br /&gt;
|-&lt;br /&gt;
| AUSGANGDATETIME || [[#Datentypen|String]] || 10 || - || Datum, wann das Etikett an den Frachtführer übermittelt worden ist (TT.MM.JJJJ)&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKDATETIME || [[#Datentypen|String]] || 19 || - || Datum, wann das Etikett im HVS32 gedruckt worden ist (TT.MM.JJJJ HH:mm:SS)&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 wenn Erfolgreich&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || Wird im Fehlerfall befüllt&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || Wird im Fehlerfall befüllt&lt;br /&gt;
|-&lt;br /&gt;
| GEBUEHR || [[#Datentypen|Decimal]] || 18 || 2 || Frachtkosten&lt;br /&gt;
|-&lt;br /&gt;
| GEBUEHRWAEHRUNG || [[#Datentypen|String]] || 3 || - || Frachkosten ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || PackstueckID aus der Anfrage&lt;br /&gt;
|-&lt;br /&gt;
| RETOURTRACKINGNR || [[#Datentypen|String]] || 50 || - || Paketnummer für die Retoure&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || Paketnummer&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGURL || [[#Datentypen|String]] || 255 || - || URL des Trackinglinks zur Sendungsverfolgung&lt;br /&gt;
|-&lt;br /&gt;
| VERSANDSENDUNGSNR || [[#Datentypen|String]] || - || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Etikett nachdrucken (VersandDatenWdhDruck) =&lt;br /&gt;
Die Gatewayfunktion VersandDatenWdhDruck wird vom Data-Gateway-Server im Automatik-Polling Modus an das HVS32 gesendet, um dort ein Etikett für ein Packstück nachzudrucken.&lt;br /&gt;
Ein Etikett wird anhand der hostseitigen Packstück-ID nachgedruckt. Diese wird im Feld PackstueckID übergeben.&lt;br /&gt;
Bei manchen Frachtführern (z.B. DPD) werden beim Nachdruck neue Trackingnummern vergeben. Somit ist die alte Trackingnummer nicht mehr gültig und das alte Versandetikett muss vernichtet werden.&lt;br /&gt;
Die neue Trackingnummer kann in der Rückmeldung zurückgemeldet werden.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTUECKID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 20 || - || &amp;#039;&amp;#039;&amp;#039;Eindeutige&amp;#039;&amp;#039;&amp;#039; Nummer für das Paket im Vorsystem.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeiten soll.&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKERNAME || [[#Datentypen|String]] || 30 || - || Ausgabekanal, an welchem das Etikett nachgedruckt werden soll (benötigt HVS32 Erweiterungsmodul &amp;quot;Druckerspooler&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || (neue) TrackingNr des Packstücks&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstück stornieren (StornoVersandDaten) =&lt;br /&gt;
Die Gatewayfunktion StornoVersandDaten wird vom Data-Gateway-Server im Automatik-Polling Modus an das HVS32 gesendet, um dort bestehende Packstücke zu stornieren, die noch nicht auf einer Ausgangsliste sind.&lt;br /&gt;
In der Regel wird ein Packstück anhand der hostseitigen Packstück-ID storniert. Diese wird im Feld PackstueckID übergeben.&lt;br /&gt;
Zusätzlich zur hostseitigen Packstück-ID kann auch die TrackingNr zur Identifikation des Packstücks beitragen, für den Fall, dass die hostseitige Packstück-ID keine Eindeutigkeit garantieren kann.&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreichem Storno wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTUECKID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 20 || - || &amp;#039;&amp;#039;&amp;#039;Eindeutige&amp;#039;&amp;#039;&amp;#039; Nummer für das Paket im Vorsystem.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeiten soll.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstück verladen/freigeben (VerladeVersandDaten) =&lt;br /&gt;
Die Gatewayfunktion VerladeVersandDaten wird vom Data-Gateway-Server im Automatik-Polling Modus an das HVS32 gesendet, um dort Packstücke für den Ausgang frei zu geben.&lt;br /&gt;
Nur Packstücke, welche für den Ausgang freigegeben wurden, werden für den Tagesabschluss berücksichtigt.&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreicher Freigabe wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTUECKID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 20 || - || &amp;#039;&amp;#039;&amp;#039;Eindeutige&amp;#039;&amp;#039;&amp;#039; Nummer für das Paket im Vorsystem.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeiten soll.&lt;br /&gt;
|-&lt;br /&gt;
| SPERRKENNZEICHEN || [[#Datentypen|String]] || 1 || - || &amp;quot;J&amp;quot; wenn das Packstück gesperrt werden soll&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Wechselbrücke auf welche das Packstück gebucht werden soll&lt;br /&gt;
|-&lt;br /&gt;
| SAMMELFREIGABE || [[#Datentypen|String]] || 1 || - || &amp;quot;T&amp;quot; bei einer Sammel-Freigabe (Alle Packstücke mit identischer VE-ReferenzNr freigeben)&lt;br /&gt;
|-&lt;br /&gt;
| VEREFERENZNR || [[#Datentypen|String]] || 20 || - || muss bei einer Sammel-Freigabe gefüllt sein&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tagesabschluss (Tagesabschluss) =&lt;br /&gt;
Das Gateway sendet die Tagesabschluss-Anfrage an das Automatik-Polling des HVS32. Im HVS32 wird somit ein Tagesabschluss anhand der zusätzlich übergebenen Parameter ausgelöst.&lt;br /&gt;
Der Tagesabschluss setzt sich aus den Punkten Ausgangsliste erzeugen und Frachtführer DFÜ erzeugen zusammen.&lt;br /&gt;
Nur Packstücke, welche für den Ausgang freigegeben wurden, werden für den Tagesabschluss berücksichtigt. Standardmäßig sind alle Packstücke freigegeben, außer sie wurden durch das Erweiterungsmodul Ausgangsscannung gesperrt.&lt;br /&gt;
Die Rückmeldung im HVS32 findet nach dem Ausführen des Tagesabschluss statt.&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreichem Tagesabschluss wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Tagesabschluss ausführen soll.&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTFUEHRERTYPLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Frachführern mitgegeben werden. Es können n-Frachtführer abgeschlossen werden.&lt;br /&gt;
(Option MultiFFTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGGEBERIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Auftraggebern mitgegeben werden. Es können n-Auftraggeber abgeschlossen werden.&lt;br /&gt;
(Option MultiAGTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| VERSANDARTIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Versandarten mitgegeben werden. Es können n-Versandarten abgeschlossen werden.&lt;br /&gt;
(Option MultiVATagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Kennzeichen der abzuschließenden Wechselbrücke. Hiermit können nur bestimmte Sendungen abgeschlossen werden.&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKERNAME || [[#Datentypen|String]] || 30 || - || Name des Ausgabekanals auf welchem die Liste gedruckt werden soll&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Ausgangsliste erzeugen (Listenabschluss) =&lt;br /&gt;
Das Gateway sendet die Listenabschluss-Anfrage an das Automatik-Polling des HVS32. Im HVS32 wird somit eine Ausgangsliste anhand der zusätzlich übergebenen Parameter erzeugt.&lt;br /&gt;
Nur Packstücke, welche für den Ausgang freigegeben wurden, werden für den Listenabschluss berücksichtigt. Standardmäßig sind alle Packstücke freigegeben, außer sie wurden durch das Erweiterungsmodul Ausgangsscannung gesperrt.&lt;br /&gt;
Die Rückmeldung im HVS32 findet nach dem Erzeugen der Ausgangsliste statt.&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreichem Listenabschluss wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Tagesabschluss ausführen soll.&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTFUEHRERTYPLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Frachführern mitgegeben werden. Es können n-Frachtführer abgeschlossen werden.&lt;br /&gt;
(Option MultiFFTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGGEBERIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Auftraggebern mitgegeben werden. Es können n-Auftraggeber abgeschlossen werden.&lt;br /&gt;
(Option MultiAGTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| VERSANDARTIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Versandarten mitgegeben werden. Es können n-Versandarten abgeschlossen werden.&lt;br /&gt;
(Option MultiVATagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Kennzeichen der abzuschließenden Wechselbrücke. Hiermit können nur bestimmte Sendungen abgeschlossen werden.&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKERNAME || [[#Datentypen|String]] || 30 || - || Name des Ausgabekanals auf welchem die Liste gedruckt werden soll&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Frachtführer DFÜ erzeugen (EDIAbschluss) =&lt;br /&gt;
Das Gateway sendet die EDIAbschluss-Anfrage an das Automatik-Polling des HVS32. Im HVS32 wird somit eine Frachtführer DFÜ anhand der zusätzlich übergebenen Parameter erzeugt und (falls konfiguriert) an den Frachtführer übertragen.&lt;br /&gt;
Nur Packstücke, für welche zuvor eine Ausgangsliste erzeugt wurde, werden für eine Frachtführer DFÜ berücksichtigt.&lt;br /&gt;
Die Rückmeldung im HVS32 findet nach dem Erzeugen der Frachtführer DFÜ statt.&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreichem EDIAbschluss wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Tagesabschluss ausführen soll.&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTFUEHRERTYPLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Frachführern mitgegeben werden. Es können n-Frachtführer abgeschlossen werden.&lt;br /&gt;
(Option MultiFFTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGGEBERIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Auftraggebern mitgegeben werden. Es können n-Auftraggeber abgeschlossen werden.&lt;br /&gt;
(Option MultiAGTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| VERSANDARTIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Versandarten mitgegeben werden. Es können n-Versandarten abgeschlossen werden.&lt;br /&gt;
(Option MultiVATagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Kennzeichen der abzuschließenden Wechselbrücke. Hiermit können nur bestimmte Sendungen abgeschlossen werden.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstückdaten prüfen (VersandDatenPruefAnfrage) =&lt;br /&gt;
Das Gateway sendet die VersandDatenPruefAnfrage an das Automatik-Polling des HVS32. Im HVS32 wird somit eine VersandDatenAnfrage simuliert.&lt;br /&gt;
Dabei werden keine Etiketten gedruckt und das Packstück bzw. das Etikett wird nicht verbucht, jedoch sind alle weiteren Prozesse identisch zur VersandDatenAnfrage (Routenermittlung, Trackingnummer-Ermittlung, Adressprüfung, etc.)&lt;br /&gt;
Diese Funktion dient dazu im Vorfeld alle Versand-Daten zu validieren.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| ANSPRECHPARTNER || [[#Datentypen|String]] || 50 || - || Empfänger Ansprechpartner&lt;br /&gt;
|-&lt;br /&gt;
| ANZAHLARTIKEL || [[#Datentypen|Integer]] || 6 || - || Anzahl Artikel (Druck auf Etikett)&lt;br /&gt;
|-&lt;br /&gt;
| [[#ArtikelDaten|ARTIKELDATEN]] || [[#Datentypen|Sequence]] &amp;#039;&amp;#039;&amp;#039;[[#ArtikelDaten|&amp;lt;ArtikelDaten&amp;gt;]]&amp;#039;&amp;#039;&amp;#039; || - || - || Eine Liste der [[#ArtikelDaten|Packstück-Artikel]] vom Typ &amp;#039;&amp;#039;&amp;#039;[[#ArtikelDaten|ArtikelDaten]]&amp;#039;&amp;#039;&amp;#039; (1:n)&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGNR || [[#Datentypen|String]] || 20 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;AUFTRAGGEBERID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Mandantenkennung aus dem HVS32&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS1 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS2 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ1 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 1&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ2 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 2&lt;br /&gt;
|-&lt;br /&gt;
| BARCODEID || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BARCODETEXT || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BARCODETYP || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BESTELLNR || [[#Datentypen|String]] || 20 || - || Metro-Bestellnr (Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKERNAME || [[#Datentypen|String]] || 30 || - || Name eines Ausgabekanals (Drucker) im HVS32 über den das Etikett gedruckt wird. (Benötigt Druckerspooler Erweiterungsmodul)&lt;br /&gt;
|-&lt;br /&gt;
| EMAIL || [[#Datentypen|String]] || 100 || - || E-Mail Adresse des Empfängers (z.B.: für die Automatische E-Mail Avisierung)&lt;br /&gt;
|-&lt;br /&gt;
| EMPFMOBILFUNKNR || [[#Datentypen|String]] || 20 || - || Mobilfunknummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FAXNR || [[#Datentypen|String]] || 20 || - || Faxnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FLEXZUSTELLUNGEMAILADRESSE || [[#Datentypen|String]] || 80 || - || Flex-Zustellung Emailadresse&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTBRIEF || [[#Datentypen|String]] || 20 || - || Frachtbrief Nummer falls Frachtbrief durch Vorsystem gedruckt werden soll&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTFUEHRERKDNR || [[#Datentypen|String]] || 10 || - || Kundennummer des Frachtzahlers beim Frachtführer&lt;br /&gt;
|-&lt;br /&gt;
| FRANKATURKENNUNG || [[#Datentypen|String]] || 10 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| [[#Gefahrgut|GEFAHRGUT]] || [[#Datentypen|Sequence]] &amp;#039;&amp;#039;&amp;#039;[[#Gefahrgut|&amp;lt;Gefahrgut&amp;gt;]]&amp;#039;&amp;#039;&amp;#039; || - || - || Eine Liste der [[#Gefahrgut|Gefahrgüter]] vom Typ &amp;#039;&amp;#039;&amp;#039;[[#Gefahrgut|Gefahrgut]]&amp;#039;&amp;#039;&amp;#039; (1:n)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEWICHT&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|Decimal]] || 8 || 3 || Bruttogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| HOSTTRACKINGNR || [[#Datentypen|String]] || 35 || - || Paketnummer aus dem Hostsystem&lt;br /&gt;
|-&lt;br /&gt;
| ILNNR || [[#Datentypen|String]] || 20 || - || ILN des Empfängers (Pflicht bei Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| KOSTENSTELLE || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| KUNDENNR || [[#Datentypen|String]] || 20 || - || Kundennummer des Empfängers beim Versender&lt;br /&gt;
|-&lt;br /&gt;
| LAGERKENNZEICHEN || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| LETZTESPACKSTUECK || [[#Datentypen|String]] || 1 || - || T/F: T=letztes Packstüeck der Sendung (wird bei Hängeversand zum Drucken der Sendungs-Hängekarte benötigt)&lt;br /&gt;
|-&lt;br /&gt;
| LIEFERANTENID || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;LIEFERSCHEINNR&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 40 || - || Wird im HVS32 als Such-Nummer verwendet&lt;br /&gt;
|-&lt;br /&gt;
| NACHNAHME || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| NETTOGEWICHT || [[#Datentypen|Decimal]] || 8 || 3 || Nettogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| NEUTBIC || [[#Datentypen|String]] || 11 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTBANKBEZEICHNUNG || [[#Datentypen|String]] || 40 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTIBAN || [[#Datentypen|String]] || 31 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTKONTOINHABER || [[#Datentypen|String]] || 40 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERLKZ || [[#Datentypen|String]] || 3 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME1 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME2 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME3 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERORT || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERPLZ || [[#Datentypen|String]] || 10 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERSTRASSE || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NNVERMERK || [[#Datentypen|String]] || 1 || - || B&amp;#039;: Bar / &amp;#039;V&amp;#039;: Verrechnungsscheck&lt;br /&gt;
|-&lt;br /&gt;
| NNVERWENDUNG || [[#Datentypen|String]] || 30 || - || Nachnahme Verwendungszweck&lt;br /&gt;
|-&lt;br /&gt;
| NNWAEHRUNG || [[#Datentypen|String]] || 3 || - || Nachnahme - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTKGES&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|Integer]] || - || - || Gesamt-Anzahl Colli der Sendung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTKNR&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|Integer]] || - || - || Laufende Nr pro Sendung&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeten soll.&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKBREITE || [[#Datentypen|Integer]] || - || - || Breite in cm&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKHOEHE || [[#Datentypen|Integer]] || - || - || Höhe in cm&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || Eindeutige Nummer für das Paket im Vorsystem. Wird als eindeutige Paketreferenz benötigt um das Etikett später zu stornieren oder zu Verladen.&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKLAENGE || [[#Datentypen|Integer]] || - || - || Länge in cm&lt;br /&gt;
|-&lt;br /&gt;
| PAPERLESSINVOICE || [[#Datentypen|String]] || 1 || - || Nur im UPS PaperlessInvoice Fall (T=PaperlessInvoice / F=nicht PaperlessInvoice)&lt;br /&gt;
|-&lt;br /&gt;
| POSTLEITCODE || [[#Datentypen|String]] || 15 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| POSTZIELFRACHTZENT || [[#Datentypen|String]] || 5 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFLKZ || [[#Datentypen|String]] || 5 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME1 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME2 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME3 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFORT || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFPLZ || [[#Datentypen|String]] || 10 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFSTRASSE || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSNR || [[#Datentypen|String]] || 20 || - || Rechnungsnummer&lt;br /&gt;
|-&lt;br /&gt;
| SENDUNGSINHALT || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| SONDERDIENSTE || [[#Datentypen|String]] || 30 || - || Versandart-spezifisch belegt&lt;br /&gt;
|-&lt;br /&gt;
| SPERRFLAG || [[#Datentypen|String]] || 1 || - || T/F: T=Sperren, sonst nicht sperren&lt;br /&gt;
|-&lt;br /&gt;
| TELEFONNR || [[#Datentypen|String]] || 20 || - || Telefonnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| TERMINART || [[#Datentypen|String]] || 1 || - || &amp;#039;A&amp;#039;b / &amp;#039;B&amp;#039;is / &amp;#039;F&amp;#039;ix&lt;br /&gt;
|-&lt;br /&gt;
| TERMINDATUM || [[#Datentypen|String]] || 10 || - || TT.MM.JJJJ&lt;br /&gt;
|-&lt;br /&gt;
| TERMINZEIT || [[#Datentypen|Calendar]] || 5 || - || HH:MM&lt;br /&gt;
|-&lt;br /&gt;
| USTIDNR || [[#Datentypen|String]] || 20 || - || UmsatzsteuerNr des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| VERPACKUNGSART || [[#Datentypen|String]] || 6 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;VERSANDARTID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Versandartkennung aus dem HVS32&lt;br /&gt;
|-&lt;br /&gt;
| VERSICHERUNGSWERT || [[#Datentypen|Decimal]] || 18 || 2 || Höhe Versicherungswert&lt;br /&gt;
|-&lt;br /&gt;
| VORPACKDATUM || [[#Datentypen|String]] || 10 || - || TT.MM.JJJJ&lt;br /&gt;
|-&lt;br /&gt;
| VWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Versicherungswert - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| WARENWERT || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Wechselbrücke, die diesem Packstück zugewiesen wird&lt;br /&gt;
|-&lt;br /&gt;
| WWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Warenwert - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| ZAHLUNGSBEDINGUNG || [[#Datentypen|String]] || 10 || - || &amp;#039;S&amp;#039; = Sender, &amp;#039;R&amp;#039; = Empfänger&lt;br /&gt;
|-&lt;br /&gt;
| ZBZOLL || [[#Datentypen|String]] || 1 || - || Zahlungsbedingung für Zoll Steuern &amp;#039;S&amp;#039; = Sender, &amp;#039;R&amp;#039; = Empfänger&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRBAHNHOF || [[#Datentypen|String]] || 30 || - || PLZ und Ort&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRLKZ&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 5 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRNAME1&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME2 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME3 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME4 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRORT&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRPLZ&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRREGION || [[#Datentypen|String]] || 20 || - || Staat/Provinz (z.B.: für Sendungen in die USA wichtig)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRSTRASSE&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung|&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 wenn Erfolgreich&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || Wird im Fehlerfall befüllt&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || Wird im Fehlerfall befüllt&lt;br /&gt;
|-&lt;br /&gt;
| GEBUEHR || [[#Datentypen|Decimal]] || 18 || 2 || Frachtkosten&lt;br /&gt;
|-&lt;br /&gt;
| GEBUEHRWAEHRUNG || [[#Datentypen|String]] || 3 || - || Frachkosten ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || PackstueckID aus der Anfrage&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstückdaten aktualisieren (UpdateVersandDaten) =&lt;br /&gt;
Die Gatewayfunktion UpdateVersandDaten wird vom Data-Gateway-Server im Automatik-Polling Modus an das HVS32 gesendet, um dort die Daten von bestehende Packstücken zu verändern.&lt;br /&gt;
Diese Anfrage wird zum Beispiel gesendet, wenn der Warenwert für ein Packstück erst zu einem späteren Zeitpunkt bekannt ist.&lt;br /&gt;
Aktualisiert werden können Daten innerhalb der Tabellen Versandeinheit, Abrechnungseinheit und Lieferung. Dabei wird stets über das Feld PackstueckID und bei Belegung auch über das Feld TrackingNr gesucht.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Bei dieser Anfrage werden allerdings die zu aktualisierenden Felder und Inhalte nicht mehr nach den Richtlinien des Frachtführers geprüft (z.B. Gewichtsgrenzen, etc.). Es muss somit vom Vorsystem sichergestellt werden, dass die aktualisierenden Werte mit den Richtlinien des Frachtführers übereinstimmen. Sollte dies nicht möglich sein, kann diese Funktion nicht genutzt werden, sondern das Etikett muss storniert und neu verarbeitet werden. Außerdem können Felder, welche bereits auf einem Etikett angedruckt oder vom Versandsystem HVS32 in einer Frachtführerabwicklung ermittelt wurden (z.B. Adresse, Route, TrackingNr, Sonderdienste, etc.) nicht manipuliert werden.&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;ACHTUNG: Alle Felder, welche im Versandsystem aktualisiert werden sollen, müssen vor der Nutzung dieser Funktion abgestimmt und im Versandsystem entsprechend konfiguriert werden!&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreichem Update wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTUECKID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 20 || - || Eindeutige Nummer für das Paket im Vorsystem. Wird als eindeutige Paketreferenz benötigt um den Datensatz zu identifizieren.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeiten soll.&lt;br /&gt;
|-&lt;br /&gt;
| ANSPRECHPARTNER || [[#Datentypen|String]] || 50 || - || Empfänger Ansprechpartner&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS1 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS2 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ1 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 1&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ2 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 2&lt;br /&gt;
|-&lt;br /&gt;
| BESTELLNR || [[#Datentypen|String]] || 20 || - || Metro-Bestellnr (Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| EMAIL || [[#Datentypen|String]] || 100 || - || E-Mail Adresse des Empfängers (z.B.: für die Automatische E-Mail Avisierung)&lt;br /&gt;
|-&lt;br /&gt;
| EMPFMOBILFUNKNR || [[#Datentypen|String]] || 20 || - || Mobilfunknummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FAXNR || [[#Datentypen|String]] || 20 || - || Faxnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FLEXZUSTELLUNGEMAILADRESSE || [[#Datentypen|String]] || 80 || - || Flex-Zustellung Emailadresse&lt;br /&gt;
|-&lt;br /&gt;
| GEWICHT || [[#Datentypen|Decimal]] || 8 || 3 || Bruttogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| NETTOGEWICHT || [[#Datentypen|Decimal]] || 8 || 3 || Nettogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| ILNNR || [[#Datentypen|String]] || 20 || - || ILN des Empfängers (Pflicht bei Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| KOSTENSTELLE || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| LIEFERANTENID || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| NACHNAHME || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| NNVERMERK || [[#Datentypen|String]] || 1 || - || B&amp;#039;: Bar / &amp;#039;V&amp;#039;: Verrechnungsscheck&lt;br /&gt;
|-&lt;br /&gt;
| NNVERWENDUNG || [[#Datentypen|String]] || 30 || - || Nachnahme Verwendungszweck&lt;br /&gt;
|-&lt;br /&gt;
| NNWAEHRUNG || [[#Datentypen|String]] || 3 || - || Nachnahme - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKBREITE || [[#Datentypen|Integer]] || - || - || Breite in cm&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKHOEHE || [[#Datentypen|Integer]] || - || - || Höhe in cm&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKLAENGE || [[#Datentypen|Integer]] || - || - || Länge in cm&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFLKZ || [[#Datentypen|String]] || 5 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME1 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME2 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME3 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFORT || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFPLZ || [[#Datentypen|String]] || 10 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFSTRASSE || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSNR || [[#Datentypen|String]] || 20 || - || Rechnungsnummer&lt;br /&gt;
|-&lt;br /&gt;
| SENDUNGSINHALT || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| TELEFONNR || [[#Datentypen|String]] || 20 || - || Telefonnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| VORPACKDATUM || [[#Datentypen|String]] || 10 || - || TT.MM.JJJJ&lt;br /&gt;
|-&lt;br /&gt;
| VERSICHERUNGSWERT || [[#Datentypen|Decimal]] || 18 || 2 || Höhe Versicherungswert&lt;br /&gt;
|-&lt;br /&gt;
| VWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Versicherungswert - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Wechselbrücke, die diesem Packstück zugewiesen wird&lt;br /&gt;
|-&lt;br /&gt;
| WARENWERT || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| WWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Warenwert - ISO-Währungscode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstückdaten anonymisieren (AnonymisiereVersandDaten) =&lt;br /&gt;
Das Gateway sendet die AnonymisiereVersandDaten an das Automatik-Polling des HVS32. Im HVS32 werden somit Kunden bezogene Daten für den entsprechenden Datensatz gemäß DSGVO anonymisiert.&lt;br /&gt;
Diese Anonymisierung wird unwiderruflich und endgültig auf der Datenbankebene des Versandsystems durchgeführt. Eine Wiederherstellung der ursprünglichen Daten ist somit nicht mehr möglich.&lt;br /&gt;
Log-Dateien, Rückmelde-Dateien, bereits übertragene Frachtführer DFÜs etc. sind hiervon nicht betroffen. Es können ausschließlich Packstücke und Sendungen anonymisiert werden, welche bereits Tages abgeschlossen sind.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || PackstückID des Packstücks, welches anonymisiert werden soll.&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || TrackingNr des Packstücks, welches anonymisiert werden soll.&lt;br /&gt;
|-&lt;br /&gt;
| LIEFERSCHEINNR || [[#Datentypen|String]] || 40 || - || LieferscheinNr der Sendung, welche anonymisiert werden soll.&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGSNR || [[#Datentypen|String]] || 50 || - || AuftragsNr der Sendung, welche anonymisiert werden soll.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der die Anonymisierung verarbeiten soll.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Statusdaten für ein Packstück abrufen (StatusDatenAnfrage) =&lt;br /&gt;
Das Gateway sendet die StatusDatenAnfrage an das Automatik-Polling des HVS32. Im HVS32 werden zu diesem Packstück alle vorhandenen Statusdaten abgerufen und ans Gateway zurückgemeldet.&amp;lt;br&amp;gt;&lt;br /&gt;
Das Packstück wird anhand der PackstueckId, der TrackingNr oder einer kombination aus beiden (falls nur einer der beiden Referenzen nicht eundeutig ist) identifiziert.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Werden im HVS32 zu der Referenz mehrere Packstücke identifiziert, so wird immer das aktuellste Packstück verwendet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || Eindeutige Packstueck-Id aus dem Hostsystem, welches das Packstück identifiziert.&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || TrackingNr des Packstuecks.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, welcher die Anfrage verarbeiten soll (Optional).&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| EINTRAGDATETIME || [[#Datentypen|String]] || 25 || - || Datum und optional Uhrzeit, wann der Statuscode ins HVS32 importiert worden ist (Format abhängig vom Betriebssystem - DE: dd.mm.yyyy hh:mm:ss)&lt;br /&gt;
|-&lt;br /&gt;
| EINTRAGDATETIME_TIMESTAMP || [[#Datentypen|String]] || 25 || - || Datum und optional Uhrzeit, wann der Statuscode ins HVS32 importiert worden ist (Format: yyyy-mm-dd hh:mm:ss.SSS)&lt;br /&gt;
|-&lt;br /&gt;
| EMPFANGSQUITTIERER || [[#Datentypen|String]] || 100 || - || Name des Empfängers, der das Paket/die Sendung entgegen nahm&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERSTATUS || [[#Datentypen|String]] || 2 || - || I = Info, F = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FFSTATUSCODE || [[#Datentypen|String]] || 10 || - || Frachtführerspezifischer Statuscode&lt;br /&gt;
|-&lt;br /&gt;
| FFSTATUSKLARTEXT || [[#Datentypen|String]] || 250 || - || Klartext der den Statuscode beschreibt&lt;br /&gt;
|-&lt;br /&gt;
| FFZUSATZCODE || [[#Datentypen|String]] || 10 || - || Zusätzlicher Statuscode&lt;br /&gt;
|-&lt;br /&gt;
| FFZUSATZKLARTEXT || [[#Datentypen|String]] || 120 || - || Klartext der den zusätzlichen Statuscode beschreibt&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || Eindeutige Packstueck-Id aus dem Hostsystem, welches das Packstück identifiziert.&lt;br /&gt;
|-&lt;br /&gt;
| STATUSDATETIME || [[#Datentypen|String]] || 25 || - || Datum und optional Uhrzeit des Statuscodes (Format abhängig vom Betriebssystem - DE: dd.mm.yyyy hh:mm:ss)&lt;br /&gt;
|-&lt;br /&gt;
| STATUSDATETIME_TIMESTAMP || [[#Datentypen|String]] || 25 || - || Datum und optional Uhrzeit des Statuscodes (Format: yyyy-mm-dd hh:mm:ss.SSS)&lt;br /&gt;
|-&lt;br /&gt;
| STATUSORT || [[#Datentypen|String]] || 30 || - || Ort an dem der Status eingetreten ist (z.B. Nummer des Depots)&lt;br /&gt;
|-&lt;br /&gt;
| STATUSTYP || [[#Datentypen|String]] || 30 || - || E = Endestatus, Z = Zwischenstatus&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || Trackingnummer&lt;br /&gt;
|-&lt;br /&gt;
| ZUSATZKLARTEXT || [[#Datentypen|String]] || 80 || - || Zusätzliche Informationen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstückdaten abrufen (PackstueckDatenAnfrage) =&lt;br /&gt;
Das Gateway sendet die PackstueckDatenAnfrage an das Automatik-Polling des HVS32. Im HVS32 werden zu diesem Packstück alle vorhandenen Informationen abgerufen und ans Gateway zurückgemeldet.&amp;lt;br&amp;gt;&lt;br /&gt;
Das Packstück wird anhand der PackstueckId, der TrackingNr oder einer kombination aus beiden (falls nur einer der beiden Referenzen nicht eundeutig ist) identifiziert.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Werden im HVS32 zu der Referenz mehrere Packstücke identifiziert, so wird immer das aktuellste Packstück verwendet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || Eindeutige Packstueck-Id aus dem Hostsystem, welches das Packstück identifiziert.&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || TrackingNr des Packstuecks.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, welcher die Anfrage verarbeiten soll (Optional).&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AUSGANGDATETIME || [[#Datentypen|String]] || 10 || - || Datum, wann das Etikett an den Frachtführer übermittelt worden ist (Format abhängig vom Betriebssystem - DE: dd.mm.yyyy)&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKDATETIME || [[#Datentypen|String]] || 25 || - || Datum, wann das Etikett im HVS32 gedruckt worden ist (Format abhängig vom Betriebssystem - DE: dd.mm.yyyy hh:mm:ss)&lt;br /&gt;
|-&lt;br /&gt;
| GEBUEHR || [[#Datentypen|Decimal]] || 18 || 2 || Frachtkosten vom Packstück oder der Sendung&lt;br /&gt;
|-&lt;br /&gt;
| GEBUEHRWAEHRUNG || [[#Datentypen|String]] || 3 || - || Frachkosten ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || Paketnummer&lt;br /&gt;
|-&lt;br /&gt;
| VERSANDSENDUNGSNR || [[#Datentypen|String]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || Eindeutige Packstueck-Id aus dem Hostsystem, welches das Packstück identifiziert.&lt;br /&gt;
|-&lt;br /&gt;
| PAKETSTATUS || [[#Datentypen|String]] || 3 || - || HVS32 code für Paketstatus&lt;br /&gt;
|-&lt;br /&gt;
| PAKETSTATUSDETAILS || [[#Datentypen|String]] || 200 || - || Beschreibung vom Paketstatus&lt;br /&gt;
|-&lt;br /&gt;
| PAKETSTATUSDETAILS_EN || [[#Datentypen|String]] || 200 || - || Englische Beschreibung vom Paketstatus&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6224</id>
		<title>HVS32 SAP RFC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6224"/>
		<updated>2025-12-05T14:28:32Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_SAP_RFC_Interface_(Polling)]]&lt;br /&gt;
&lt;br /&gt;
= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.8.40 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP RFC Server&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Es können beliebige RFC Funktionen im DGS implementiert werden, welche von einem RFC-Client (SAP) aus aufgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Je HVS32 Funktion muss ein separater RFC Baustein genutzt werden. Die Struktur des RFC-Bausteins (Felder, Tabellen, Strukturen) ohne Implementierung muss im SAP System auf einem Applikationsserver für den DGS verfügbar sein - da die Metadaten der RFC Bausteine bei Systemstart abgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS registriert sich selbst unter einer Programm-ID an einem SAP Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
RFCServerCentralSAPGateway.png|DGS SAP/RFC Server an zentralem SAP Gateway&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in &amp;#039;&amp;#039;&amp;#039;64Bit&amp;#039;&amp;#039;&amp;#039; (sapjco3.jar + sapjco3.dll)&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ &amp;#039;&amp;#039;&amp;#039;64bit&amp;#039;&amp;#039;&amp;#039; voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
** alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
** Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* SAP RFC User mit entsprechender Berechtigung&lt;br /&gt;
** Bzgl. der Berechtigung kann man mit dem &amp;#039;&amp;#039;SAP note 460089 - Minimum authorization profiles for external RFC programs&amp;#039;&amp;#039; anfangen&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Servername / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| rfcfunctions || Liste aller RFC-Funktionsbausteinen, welche im SAP bereitgestellt werden&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im RFC Baustein als Table oder Struct definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Alle Parameter, welche an das HVS32 gesendet werden sollen, müssen in die Import-Parameter geschrieben werden. Die Rückmeldung aus dem HVS32 erfolgt in den Export-Parametern. Die Kommunikation ist bidirektional, d.h. die Rückmeldung erfolgt synchron in der gleichen Transaktion wie die Anfrage.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die VersandDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSVERSANDDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    KUNDENNR CHAR(20)&lt;br /&gt;
    ZIELADRNAME1 CHAR(50)&lt;br /&gt;
    ZIELADRNAME2 CHAR(50)&lt;br /&gt;
    ZIELADRNAME3 CHAR(50)&lt;br /&gt;
    ZIELADRSTRASSE CHAR(50)&lt;br /&gt;
    ZIELADRLKZ CHAR(5)&lt;br /&gt;
    ZIELADRPLZ CHAR(10)&lt;br /&gt;
    ZIELADRORT CHAR(50)&lt;br /&gt;
    ZIELADRREGION CHAR(20)&lt;br /&gt;
    ZIELADRBAHNHOF CHAR(30)&lt;br /&gt;
    ANSPRECHPARTNER CHAR(20)&lt;br /&gt;
    TELEFONNR CHAR(20)&lt;br /&gt;
    FAXNR CHAR(20)&lt;br /&gt;
    USTIDNR CHAR(20)&lt;br /&gt;
    ILNNR CHAR(20)&lt;br /&gt;
    AUFTRAGGEBERID CHAR(10)&lt;br /&gt;
    VERSANDARTID CHAR(10)&lt;br /&gt;
    AVISHINWEIS1 CHAR(30)&lt;br /&gt;
    AVISHINWEIS2 CHAR(30)&lt;br /&gt;
    AVISZUSATZ1 CHAR(20)&lt;br /&gt;
    AVISZUSATZ2 CHAR(20)&lt;br /&gt;
    LIEFERSCHEINNR CHAR(40)&lt;br /&gt;
    AUFTRAGNR CHAR(20)&lt;br /&gt;
    BESTELLNR CHAR(20)&lt;br /&gt;
    WARENWERT CHAR(19)&lt;br /&gt;
    WWWAEHRUNG CHAR(3)&lt;br /&gt;
    NACHNAHME CHAR(19)&lt;br /&gt;
    NNWAEHRUNG CHAR(3)&lt;br /&gt;
    NNVERMERK CHAR(1)&lt;br /&gt;
    NNVERWENDUNG CHAR(30)&lt;br /&gt;
    VERSICHERUNGSWERT CHAR(19)&lt;br /&gt;
    VWWAEHRUNG CHAR(3)&lt;br /&gt;
    FRANKATURKENNUNG CHAR(10)&lt;br /&gt;
    ZAHLUNGSBEDIGNUNG CHAR(10)&lt;br /&gt;
    ZBZOLL CHAR(1)&lt;br /&gt;
    FRACHTFUEHRERKDNR CHAR(10)&lt;br /&gt;
    SONDERDIENSTE CHAR(30)&lt;br /&gt;
    SENDUNGSINHALT CHAR(30)&lt;br /&gt;
    TERMINART CHAR(1)&lt;br /&gt;
    TERMINDATUM CHAR(10)&lt;br /&gt;
    TERMINZEIT CHAR(5)&lt;br /&gt;
    NEUTABSENDERNAME1 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME2 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME3 CHAR(30)&lt;br /&gt;
    NEUTABSENDERSTRASSE CHAR(30)&lt;br /&gt;
    NEUTABSENDERLKZ CHAR(3)&lt;br /&gt;
    NEUTABSENDERPLZ CHAR(10)&lt;br /&gt;
    NEUTABSENDERORT CHAR(30)&lt;br /&gt;
    RECHNUNGSEMPFNAME1 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME2 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME3 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFSTRASSE CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFLKZ CHAR(5)&lt;br /&gt;
    RECHNUNGSEMPFPLZ CHAR(10)&lt;br /&gt;
    RECHNUNGSEMPFORT CHAR(50)&lt;br /&gt;
    POSTLEITCODE CHAR(15)&lt;br /&gt;
    POSTZIELFRACHTZENT CHAR(5)&lt;br /&gt;
    FRACHTBRIEF CHAR(20)&lt;br /&gt;
    GEWICHT CHAR(9)&lt;br /&gt;
    NETTOGEWICHT CHAR(9)&lt;br /&gt;
    PACKSTKGES CHAR(10)&lt;br /&gt;
    PACKSTKNR CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(6)&lt;br /&gt;
    PACKSTUECKLAENGE CHAR(10)&lt;br /&gt;
    PACKSTUECKBREITE CHAR(10)&lt;br /&gt;
    PACKSTUECKHOEHE CHAR(10)&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(15)&lt;br /&gt;
    ANZAHLARTIKEL CHAR(10)&lt;br /&gt;
    ZUSATZZEILE1 CHAR(150)&lt;br /&gt;
    ZUSATZZEILE2 CHAR(150)&lt;br /&gt;
    FREIAVIS1 CHAR(62)&lt;br /&gt;
    FREIAVIS2 CHAR(62)&lt;br /&gt;
    HVELEKTRONIKARTIKEL CHAR(1)&lt;br /&gt;
    EMPFEMAILADRESSE CHAR(100)&lt;br /&gt;
    KOSTENSTELLE CHAR(30)&lt;br /&gt;
    DRUCKERNAME CHAR(30)&lt;br /&gt;
  DGPOSITIONS STRUCTURE&lt;br /&gt;
    GEFAHRGUTUNNR CHAR(4)&lt;br /&gt;
    GEFAHRGUTKLASSE CHAR(6)&lt;br /&gt;
    GEFAHRGUTVPG CHAR(5)&lt;br /&gt;
    GEFAHRGUTKCODE CHAR(5)&lt;br /&gt;
    GEFAHRGUTBEZEICHNUNG CHAR(110)&lt;br /&gt;
    GEFAHRGUTMENGE CHAR(9)&lt;br /&gt;
    GEFAHRGUTBEGRENZTEMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTVERPANZAHL CHAR(10)&lt;br /&gt;
    GEFAHRGUTVERPACKUNGSART CHAR(8)&lt;br /&gt;
    GEFAHRGUTNEBENGEFAHR CHAR(20)&lt;br /&gt;
    GEFAHRGUTBUCHST640 CHAR(1)&lt;br /&gt;
    GEFAHRGUTMENGENEINHEIT CHAR(2)&lt;br /&gt;
    GEFAHRGUTBEFOERDKAT CHAR(10)&lt;br /&gt;
    GEFAHRGUTFAKTOR CHAR(10)&lt;br /&gt;
    GEFAHRGUTNETTOEXPLMASSE CHAR(9)&lt;br /&gt;
    GEFAHRGUTTUNNELBCODE CHAR(10)&lt;br /&gt;
    GEFAHRGUTFREIGESTMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTFFCODE CHAR(20)&lt;br /&gt;
  DELIVERYPOSITIONS STRUCTURE&lt;br /&gt;
    ANZAHLPOSETIKETTEN CHAR()&lt;br /&gt;
    ARTIKELBTNNR CHAR(25)&lt;br /&gt;
    ARTIKELEAN CHAR(20)&lt;br /&gt;
    ARTIKELEINHEIT CHAR(10)&lt;br /&gt;
    ARTIKELGEWICHT CHAR(9)&lt;br /&gt;
    ARTIKELMENGE CHAR(9)&lt;br /&gt;
    ARTIKELSOLLMENGE CHAR(9)&lt;br /&gt;
    ARTIKELTEXT1 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT2 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT3 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT4 CHAR(100)&lt;br /&gt;
    ARTIKELWAEHRUNG CHAR(3)&lt;br /&gt;
    ARTIKELWERT CHAR(9)&lt;br /&gt;
    CHARGEFLAG CHAR(1)&lt;br /&gt;
    KUNDENARTIKELNR CHAR(50)&lt;br /&gt;
    KUNDENBESTELLNR CHAR(50)&lt;br /&gt;
    POSAUFTRAGNR CHAR(50)&lt;br /&gt;
    POSITIONNR CHAR(40)&lt;br /&gt;
    POSLIEFERNR CHAR(40)&lt;br /&gt;
    SERIENNR CHAR(30)&lt;br /&gt;
    URSPRUNGLAND CHAR(2)&lt;br /&gt;
    ARTIKELGRUPPE CHAR(50)&lt;br /&gt;
    ARTIKELSERVICES CHAR(100)&lt;br /&gt;
    ARTIKELVOLUMEN CHAR(9)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    VERSANDSENDUNGSNR CHAR(20)&lt;br /&gt;
    DRUCKDATETIME CHAR(10)&lt;br /&gt;
    AUSGANGDATETIME CHAR(10)&lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
    FEHLERCODE CHAR(1)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die StatusDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;Z_STATUSDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(30)&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  STATUSDATEN TABLE&lt;br /&gt;
    PACKSTUECKID CHAR(30)&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    EINTRAGDATETIME CHAR(20)&lt;br /&gt;
    EMPFANGSQUITTIERER CHAR(100)&lt;br /&gt;
    FEHLERSTATUS CHAR(2)&lt;br /&gt;
    FFSTATUSCODE CHAR(10)&lt;br /&gt;
    FFSTATUSKLARTEXT CHAR(250)&lt;br /&gt;
    FFZUSATZCODE CHAR(10)&lt;br /&gt;
    FFZUSATZKLARTEXT CHAR(120)&lt;br /&gt;
    STATUSDATETIME CHAR(20)&lt;br /&gt;
    STATUSORT CHAR(30)&lt;br /&gt;
    STATUSTYP CHAR(2)&lt;br /&gt;
    ZUSATZKLARTEXT CHAR(80)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die PackstueckDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;Z_PACKSTUECKDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(30)&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
    PAKETSTATUS CHAR(3)&lt;br /&gt;
    PAKETSTATUSDETAILS CHAR(200)&lt;br /&gt;
    PAKETSTATUSDETAILS_EN CHAR(200)&lt;br /&gt;
    PACKSTUECKID CHAR(20)&lt;br /&gt;
    VERSANDSENDUNGSNR CHAR(20)&lt;br /&gt;
    DRUCKDATETIME CHAR(10)&lt;br /&gt;
    AUSGANGDATETIME CHAR(10)&lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
    FEHLERCODE CHAR(1)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6223</id>
		<title>HVS32 SAP RFC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6223"/>
		<updated>2025-12-05T14:23:04Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_SAP_RFC_Interface_(Polling)]]&lt;br /&gt;
&lt;br /&gt;
= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.8.40 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP RFC Server&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Es können beliebige RFC Funktionen im DGS implementiert werden, welche von einem RFC-Client (SAP) aus aufgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Je HVS32 Funktion muss ein separater RFC Baustein genutzt werden. Die Struktur des RFC-Bausteins (Felder, Tabellen, Strukturen) ohne Implementierung muss im SAP System auf einem Applikationsserver für den DGS verfügbar sein - da die Metadaten der RFC Bausteine bei Systemstart abgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS registriert sich selbst unter einer Programm-ID an einem SAP Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
RFCServerCentralSAPGateway.png|DGS SAP/RFC Server an zentralem SAP Gateway&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in &amp;#039;&amp;#039;&amp;#039;64Bit&amp;#039;&amp;#039;&amp;#039; (sapjco3.jar + sapjco3.dll)&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ &amp;#039;&amp;#039;&amp;#039;64bit&amp;#039;&amp;#039;&amp;#039; voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
** alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
** Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* SAP RFC User mit entsprechender Berechtigung&lt;br /&gt;
** Bzgl. der Berechtigung kann man mit dem &amp;#039;&amp;#039;SAP note 460089 - Minimum authorization profiles for external RFC programs&amp;#039;&amp;#039; anfangen&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Servername / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| rfcfunctions || Liste aller RFC-Funktionsbausteinen, welche im SAP bereitgestellt werden&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im RFC Baustein als Table oder Struct definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Alle Parameter, welche an das HVS32 gesendet werden sollen, müssen in die Import-Parameter geschrieben werden. Die Rückmeldung aus dem HVS32 erfolgt in den Export-Parametern. Die Kommunikation ist bidirektional, d.h. die Rückmeldung erfolgt synchron in der gleichen Transaktion wie die Anfrage.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die VersandDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSVERSANDDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    KUNDENNR CHAR(20)&lt;br /&gt;
    ZIELADRNAME1 CHAR(50)&lt;br /&gt;
    ZIELADRNAME2 CHAR(50)&lt;br /&gt;
    ZIELADRNAME3 CHAR(50)&lt;br /&gt;
    ZIELADRSTRASSE CHAR(50)&lt;br /&gt;
    ZIELADRLKZ CHAR(5)&lt;br /&gt;
    ZIELADRPLZ CHAR(10)&lt;br /&gt;
    ZIELADRORT CHAR(50)&lt;br /&gt;
    ZIELADRREGION CHAR(20)&lt;br /&gt;
    ZIELADRBAHNHOF CHAR(30)&lt;br /&gt;
    ANSPRECHPARTNER CHAR(20)&lt;br /&gt;
    TELEFONNR CHAR(20)&lt;br /&gt;
    FAXNR CHAR(20)&lt;br /&gt;
    USTIDNR CHAR(20)&lt;br /&gt;
    ILNNR CHAR(20)&lt;br /&gt;
    AUFTRAGGEBERID CHAR(10)&lt;br /&gt;
    VERSANDARTID CHAR(10)&lt;br /&gt;
    AVISHINWEIS1 CHAR(30)&lt;br /&gt;
    AVISHINWEIS2 CHAR(30)&lt;br /&gt;
    AVISZUSATZ1 CHAR(20)&lt;br /&gt;
    AVISZUSATZ2 CHAR(20)&lt;br /&gt;
    LIEFERSCHEINNR CHAR(40)&lt;br /&gt;
    AUFTRAGNR CHAR(20)&lt;br /&gt;
    BESTELLNR CHAR(20)&lt;br /&gt;
    WARENWERT CHAR(19)&lt;br /&gt;
    WWWAEHRUNG CHAR(3)&lt;br /&gt;
    NACHNAHME CHAR(19)&lt;br /&gt;
    NNWAEHRUNG CHAR(3)&lt;br /&gt;
    NNVERMERK CHAR(1)&lt;br /&gt;
    NNVERWENDUNG CHAR(30)&lt;br /&gt;
    VERSICHERUNGSWERT CHAR(19)&lt;br /&gt;
    VWWAEHRUNG CHAR(3)&lt;br /&gt;
    FRANKATURKENNUNG CHAR(10)&lt;br /&gt;
    ZAHLUNGSBEDIGNUNG CHAR(10)&lt;br /&gt;
    ZBZOLL CHAR(1)&lt;br /&gt;
    FRACHTFUEHRERKDNR CHAR(10)&lt;br /&gt;
    SONDERDIENSTE CHAR(30)&lt;br /&gt;
    SENDUNGSINHALT CHAR(30)&lt;br /&gt;
    TERMINART CHAR(1)&lt;br /&gt;
    TERMINDATUM CHAR(10)&lt;br /&gt;
    TERMINZEIT CHAR(5)&lt;br /&gt;
    NEUTABSENDERNAME1 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME2 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME3 CHAR(30)&lt;br /&gt;
    NEUTABSENDERSTRASSE CHAR(30)&lt;br /&gt;
    NEUTABSENDERLKZ CHAR(3)&lt;br /&gt;
    NEUTABSENDERPLZ CHAR(10)&lt;br /&gt;
    NEUTABSENDERORT CHAR(30)&lt;br /&gt;
    RECHNUNGSEMPFNAME1 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME2 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME3 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFSTRASSE CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFLKZ CHAR(5)&lt;br /&gt;
    RECHNUNGSEMPFPLZ CHAR(10)&lt;br /&gt;
    RECHNUNGSEMPFORT CHAR(50)&lt;br /&gt;
    POSTLEITCODE CHAR(15)&lt;br /&gt;
    POSTZIELFRACHTZENT CHAR(5)&lt;br /&gt;
    FRACHTBRIEF CHAR(20)&lt;br /&gt;
    GEWICHT CHAR(9)&lt;br /&gt;
    NETTOGEWICHT CHAR(9)&lt;br /&gt;
    PACKSTKGES CHAR(10)&lt;br /&gt;
    PACKSTKNR CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(6)&lt;br /&gt;
    PACKSTUECKLAENGE CHAR(10)&lt;br /&gt;
    PACKSTUECKBREITE CHAR(10)&lt;br /&gt;
    PACKSTUECKHOEHE CHAR(10)&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(15)&lt;br /&gt;
    ANZAHLARTIKEL CHAR(10)&lt;br /&gt;
    ZUSATZZEILE1 CHAR(150)&lt;br /&gt;
    ZUSATZZEILE2 CHAR(150)&lt;br /&gt;
    FREIAVIS1 CHAR(62)&lt;br /&gt;
    FREIAVIS2 CHAR(62)&lt;br /&gt;
    HVELEKTRONIKARTIKEL CHAR(1)&lt;br /&gt;
    EMPFEMAILADRESSE CHAR(100)&lt;br /&gt;
    KOSTENSTELLE CHAR(30)&lt;br /&gt;
    DRUCKERNAME CHAR(30)&lt;br /&gt;
  DGPOSITIONS STRUCTURE&lt;br /&gt;
    GEFAHRGUTUNNR CHAR(4)&lt;br /&gt;
    GEFAHRGUTKLASSE CHAR(6)&lt;br /&gt;
    GEFAHRGUTVPG CHAR(5)&lt;br /&gt;
    GEFAHRGUTKCODE CHAR(5)&lt;br /&gt;
    GEFAHRGUTBEZEICHNUNG CHAR(110)&lt;br /&gt;
    GEFAHRGUTMENGE CHAR(9)&lt;br /&gt;
    GEFAHRGUTBEGRENZTEMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTVERPANZAHL CHAR(10)&lt;br /&gt;
    GEFAHRGUTVERPACKUNGSART CHAR(8)&lt;br /&gt;
    GEFAHRGUTNEBENGEFAHR CHAR(20)&lt;br /&gt;
    GEFAHRGUTBUCHST640 CHAR(1)&lt;br /&gt;
    GEFAHRGUTMENGENEINHEIT CHAR(2)&lt;br /&gt;
    GEFAHRGUTBEFOERDKAT CHAR(10)&lt;br /&gt;
    GEFAHRGUTFAKTOR CHAR(10)&lt;br /&gt;
    GEFAHRGUTNETTOEXPLMASSE CHAR(9)&lt;br /&gt;
    GEFAHRGUTTUNNELBCODE CHAR(10)&lt;br /&gt;
    GEFAHRGUTFREIGESTMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTFFCODE CHAR(20)&lt;br /&gt;
  DELIVERYPOSITIONS STRUCTURE&lt;br /&gt;
    ANZAHLPOSETIKETTEN CHAR()&lt;br /&gt;
    ARTIKELBTNNR CHAR(25)&lt;br /&gt;
    ARTIKELEAN CHAR(20)&lt;br /&gt;
    ARTIKELEINHEIT CHAR(10)&lt;br /&gt;
    ARTIKELGEWICHT CHAR(9)&lt;br /&gt;
    ARTIKELMENGE CHAR(9)&lt;br /&gt;
    ARTIKELSOLLMENGE CHAR(9)&lt;br /&gt;
    ARTIKELTEXT1 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT2 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT3 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT4 CHAR(100)&lt;br /&gt;
    ARTIKELWAEHRUNG CHAR(3)&lt;br /&gt;
    ARTIKELWERT CHAR(9)&lt;br /&gt;
    CHARGEFLAG CHAR(1)&lt;br /&gt;
    KUNDENARTIKELNR CHAR(50)&lt;br /&gt;
    KUNDENBESTELLNR CHAR(50)&lt;br /&gt;
    POSAUFTRAGNR CHAR(50)&lt;br /&gt;
    POSITIONNR CHAR(40)&lt;br /&gt;
    POSLIEFERNR CHAR(40)&lt;br /&gt;
    SERIENNR CHAR(30)&lt;br /&gt;
    URSPRUNGLAND CHAR(2)&lt;br /&gt;
    ARTIKELGRUPPE CHAR(50)&lt;br /&gt;
    ARTIKELSERVICES CHAR(100)&lt;br /&gt;
    ARTIKELVOLUMEN CHAR(9)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    VERSANDSENDUNGSNR CHAR(20)&lt;br /&gt;
    DRUCKDATETIME CHAR(10)&lt;br /&gt;
    AUSGANGDATETIME CHAR(10)&lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die StatusDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;Z_STATUSDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(30)&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  STATUSDATEN TABLE&lt;br /&gt;
    PACKSTUECKID CHAR(30)&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    EINTRAGDATETIME CHAR(20)&lt;br /&gt;
    EMPFANGSQUITTIERER CHAR(100)&lt;br /&gt;
    FEHLERSTATUS CHAR(2)&lt;br /&gt;
    FFSTATUSCODE CHAR(10)&lt;br /&gt;
    FFSTATUSKLARTEXT CHAR(250)&lt;br /&gt;
    FFZUSATZCODE CHAR(10)&lt;br /&gt;
    FFZUSATZKLARTEXT CHAR(120)&lt;br /&gt;
    STATUSDATETIME CHAR(20)&lt;br /&gt;
    STATUSORT CHAR(30)&lt;br /&gt;
    STATUSTYP CHAR(2)&lt;br /&gt;
    ZUSATZKLARTEXT CHAR(80)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6222</id>
		<title>HVS32 SAP RFC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6222"/>
		<updated>2025-12-05T14:22:04Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_SAP_RFC_Interface_(Polling)]]&lt;br /&gt;
&lt;br /&gt;
= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.8.40 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP RFC Server&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Es können beliebige RFC Funktionen im DGS implementiert werden, welche von einem RFC-Client (SAP) aus aufgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Je HVS32 Funktion muss ein separater RFC Baustein genutzt werden. Die Struktur des RFC-Bausteins (Felder, Tabellen, Strukturen) ohne Implementierung muss im SAP System auf einem Applikationsserver für den DGS verfügbar sein - da die Metadaten der RFC Bausteine bei Systemstart abgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS registriert sich selbst unter einer Programm-ID an einem SAP Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
RFCServerCentralSAPGateway.png|DGS SAP/RFC Server an zentralem SAP Gateway&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in &amp;#039;&amp;#039;&amp;#039;64Bit&amp;#039;&amp;#039;&amp;#039; (sapjco3.jar + sapjco3.dll)&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ &amp;#039;&amp;#039;&amp;#039;64bit&amp;#039;&amp;#039;&amp;#039; voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
** alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
** Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* SAP RFC User mit entsprechender Berechtigung&lt;br /&gt;
** Bzgl. der Berechtigung kann man mit dem &amp;#039;&amp;#039;SAP note 460089 - Minimum authorization profiles for external RFC programs&amp;#039;&amp;#039; anfangen&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Servername / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| rfcfunctions || Liste aller RFC-Funktionsbausteinen, welche im SAP bereitgestellt werden&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im RFC Baustein als Table oder Struct definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Alle Parameter, welche an das HVS32 gesendet werden sollen, müssen in die Import-Parameter geschrieben werden. Die Rückmeldung aus dem HVS32 erfolgt in den Export-Parametern. Die Kommunikation ist bidirektional, d.h. die Rückmeldung erfolgt synchron in der gleichen Transaktion wie die Anfrage.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die VersandDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSVERSANDDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    KUNDENNR CHAR(20)&lt;br /&gt;
    ZIELADRNAME1 CHAR(50)&lt;br /&gt;
    ZIELADRNAME2 CHAR(50)&lt;br /&gt;
    ZIELADRNAME3 CHAR(50)&lt;br /&gt;
    ZIELADRSTRASSE CHAR(50)&lt;br /&gt;
    ZIELADRLKZ CHAR(5)&lt;br /&gt;
    ZIELADRPLZ CHAR(10)&lt;br /&gt;
    ZIELADRORT CHAR(50)&lt;br /&gt;
    ZIELADRREGION CHAR(20)&lt;br /&gt;
    ZIELADRBAHNHOF CHAR(30)&lt;br /&gt;
    ANSPRECHPARTNER CHAR(20)&lt;br /&gt;
    TELEFONNR CHAR(20)&lt;br /&gt;
    FAXNR CHAR(20)&lt;br /&gt;
    USTIDNR CHAR(20)&lt;br /&gt;
    ILNNR CHAR(20)&lt;br /&gt;
    AUFTRAGGEBERID CHAR(10)&lt;br /&gt;
    VERSANDARTID CHAR(10)&lt;br /&gt;
    AVISHINWEIS1 CHAR(30)&lt;br /&gt;
    AVISHINWEIS2 CHAR(30)&lt;br /&gt;
    AVISZUSATZ1 CHAR(20)&lt;br /&gt;
    AVISZUSATZ2 CHAR(20)&lt;br /&gt;
    LIEFERSCHEINNR CHAR(40)&lt;br /&gt;
    AUFTRAGNR CHAR(20)&lt;br /&gt;
    BESTELLNR CHAR(20)&lt;br /&gt;
    WARENWERT CHAR(19)&lt;br /&gt;
    WWWAEHRUNG CHAR(3)&lt;br /&gt;
    NACHNAHME CHAR(19)&lt;br /&gt;
    NNWAEHRUNG CHAR(3)&lt;br /&gt;
    NNVERMERK CHAR(1)&lt;br /&gt;
    NNVERWENDUNG CHAR(30)&lt;br /&gt;
    VERSICHERUNGSWERT CHAR(19)&lt;br /&gt;
    VWWAEHRUNG CHAR(3)&lt;br /&gt;
    FRANKATURKENNUNG CHAR(10)&lt;br /&gt;
    ZAHLUNGSBEDIGNUNG CHAR(10)&lt;br /&gt;
    ZBZOLL CHAR(1)&lt;br /&gt;
    FRACHTFUEHRERKDNR CHAR(10)&lt;br /&gt;
    SONDERDIENSTE CHAR(30)&lt;br /&gt;
    SENDUNGSINHALT CHAR(30)&lt;br /&gt;
    TERMINART CHAR(1)&lt;br /&gt;
    TERMINDATUM CHAR(10)&lt;br /&gt;
    TERMINZEIT CHAR(5)&lt;br /&gt;
    NEUTABSENDERNAME1 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME2 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME3 CHAR(30)&lt;br /&gt;
    NEUTABSENDERSTRASSE CHAR(30)&lt;br /&gt;
    NEUTABSENDERLKZ CHAR(3)&lt;br /&gt;
    NEUTABSENDERPLZ CHAR(10)&lt;br /&gt;
    NEUTABSENDERORT CHAR(30)&lt;br /&gt;
    RECHNUNGSEMPFNAME1 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME2 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME3 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFSTRASSE CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFLKZ CHAR(5)&lt;br /&gt;
    RECHNUNGSEMPFPLZ CHAR(10)&lt;br /&gt;
    RECHNUNGSEMPFORT CHAR(50)&lt;br /&gt;
    POSTLEITCODE CHAR(15)&lt;br /&gt;
    POSTZIELFRACHTZENT CHAR(5)&lt;br /&gt;
    FRACHTBRIEF CHAR(20)&lt;br /&gt;
    GEWICHT CHAR(9)&lt;br /&gt;
    NETTOGEWICHT CHAR(9)&lt;br /&gt;
    PACKSTKGES CHAR(10)&lt;br /&gt;
    PACKSTKNR CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(6)&lt;br /&gt;
    PACKSTUECKLAENGE CHAR(10)&lt;br /&gt;
    PACKSTUECKBREITE CHAR(10)&lt;br /&gt;
    PACKSTUECKHOEHE CHAR(10)&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(15)&lt;br /&gt;
    ANZAHLARTIKEL CHAR(10)&lt;br /&gt;
    ZUSATZZEILE1 CHAR(150)&lt;br /&gt;
    ZUSATZZEILE2 CHAR(150)&lt;br /&gt;
    FREIAVIS1 CHAR(62)&lt;br /&gt;
    FREIAVIS2 CHAR(62)&lt;br /&gt;
    HVELEKTRONIKARTIKEL CHAR(1)&lt;br /&gt;
    EMPFEMAILADRESSE CHAR(100)&lt;br /&gt;
    KOSTENSTELLE CHAR(30)&lt;br /&gt;
    DRUCKERNAME CHAR(30)&lt;br /&gt;
  DGPOSITIONS STRUCTURE&lt;br /&gt;
    GEFAHRGUTUNNR CHAR(4)&lt;br /&gt;
    GEFAHRGUTKLASSE CHAR(6)&lt;br /&gt;
    GEFAHRGUTVPG CHAR(5)&lt;br /&gt;
    GEFAHRGUTKCODE CHAR(5)&lt;br /&gt;
    GEFAHRGUTBEZEICHNUNG CHAR(110)&lt;br /&gt;
    GEFAHRGUTMENGE CHAR(9)&lt;br /&gt;
    GEFAHRGUTBEGRENZTEMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTVERPANZAHL CHAR(10)&lt;br /&gt;
    GEFAHRGUTVERPACKUNGSART CHAR(8)&lt;br /&gt;
    GEFAHRGUTNEBENGEFAHR CHAR(20)&lt;br /&gt;
    GEFAHRGUTBUCHST640 CHAR(1)&lt;br /&gt;
    GEFAHRGUTMENGENEINHEIT CHAR(2)&lt;br /&gt;
    GEFAHRGUTBEFOERDKAT CHAR(10)&lt;br /&gt;
    GEFAHRGUTFAKTOR CHAR(10)&lt;br /&gt;
    GEFAHRGUTNETTOEXPLMASSE CHAR(9)&lt;br /&gt;
    GEFAHRGUTTUNNELBCODE CHAR(10)&lt;br /&gt;
    GEFAHRGUTFREIGESTMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTFFCODE CHAR(20)&lt;br /&gt;
  DELIVERYPOSITIONS STRUCTURE&lt;br /&gt;
    ANZAHLPOSETIKETTEN CHAR()&lt;br /&gt;
    ARTIKELBTNNR CHAR(25)&lt;br /&gt;
    ARTIKELEAN CHAR(20)&lt;br /&gt;
    ARTIKELEINHEIT CHAR(10)&lt;br /&gt;
    ARTIKELGEWICHT CHAR(9)&lt;br /&gt;
    ARTIKELMENGE CHAR(9)&lt;br /&gt;
    ARTIKELSOLLMENGE CHAR(9)&lt;br /&gt;
    ARTIKELTEXT1 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT2 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT3 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT4 CHAR(100)&lt;br /&gt;
    ARTIKELWAEHRUNG CHAR(3)&lt;br /&gt;
    ARTIKELWERT CHAR(9)&lt;br /&gt;
    CHARGEFLAG CHAR(1)&lt;br /&gt;
    KUNDENARTIKELNR CHAR(50)&lt;br /&gt;
    KUNDENBESTELLNR CHAR(50)&lt;br /&gt;
    POSAUFTRAGNR CHAR(50)&lt;br /&gt;
    POSITIONNR CHAR(40)&lt;br /&gt;
    POSLIEFERNR CHAR(40)&lt;br /&gt;
    SERIENNR CHAR(30)&lt;br /&gt;
    URSPRUNGLAND CHAR(2)&lt;br /&gt;
    ARTIKELGRUPPE CHAR(50)&lt;br /&gt;
    ARTIKELSERVICES CHAR(100)&lt;br /&gt;
    ARTIKELVOLUMEN CHAR(9)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    VERSANDSENDUNGSNR CHAR(20)&lt;br /&gt;
    DRUCKDATETIME CHAR(10)&lt;br /&gt;
    AUSGANGDATETIME CHAR(10)&lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die StatusDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;Z_STATUSDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(30)&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
    FEHLERCODE CHAR(1)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
    STATUSDATEN TABLE&lt;br /&gt;
      PACKSTUECKID CHAR(30)&lt;br /&gt;
      TRACKINGNR CHAR(35)&lt;br /&gt;
      EINTRAGDATETIME CHAR(20)&lt;br /&gt;
      EMPFANGSQUITTIERER CHAR(100)&lt;br /&gt;
      FEHLERSTATUS CHAR(2)&lt;br /&gt;
      FFSTATUSCODE CHAR(10)&lt;br /&gt;
      FFSTATUSKLARTEXT CHAR(250)&lt;br /&gt;
      FFZUSATZCODE CHAR(10)&lt;br /&gt;
      FFZUSATZKLARTEXT CHAR(120)&lt;br /&gt;
      STATUSDATETIME CHAR(20)&lt;br /&gt;
      STATUSORT CHAR(30)&lt;br /&gt;
      STATUSTYP CHAR(2)&lt;br /&gt;
      ZUSATZKLARTEXT CHAR(80)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6221</id>
		<title>HVS32 SAP RFC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6221"/>
		<updated>2025-12-05T14:21:45Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_SAP_RFC_Interface_(Polling)]]&lt;br /&gt;
&lt;br /&gt;
= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.8.40 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP RFC Server&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Es können beliebige RFC Funktionen im DGS implementiert werden, welche von einem RFC-Client (SAP) aus aufgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Je HVS32 Funktion muss ein separater RFC Baustein genutzt werden. Die Struktur des RFC-Bausteins (Felder, Tabellen, Strukturen) ohne Implementierung muss im SAP System auf einem Applikationsserver für den DGS verfügbar sein - da die Metadaten der RFC Bausteine bei Systemstart abgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS registriert sich selbst unter einer Programm-ID an einem SAP Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
RFCServerCentralSAPGateway.png|DGS SAP/RFC Server an zentralem SAP Gateway&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in &amp;#039;&amp;#039;&amp;#039;64Bit&amp;#039;&amp;#039;&amp;#039; (sapjco3.jar + sapjco3.dll)&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ &amp;#039;&amp;#039;&amp;#039;64bit&amp;#039;&amp;#039;&amp;#039; voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
** alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
** Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* SAP RFC User mit entsprechender Berechtigung&lt;br /&gt;
** Bzgl. der Berechtigung kann man mit dem &amp;#039;&amp;#039;SAP note 460089 - Minimum authorization profiles for external RFC programs&amp;#039;&amp;#039; anfangen&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Servername / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| rfcfunctions || Liste aller RFC-Funktionsbausteinen, welche im SAP bereitgestellt werden&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im RFC Baustein als Table oder Struct definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Alle Parameter, welche an das HVS32 gesendet werden sollen, müssen in die Import-Parameter geschrieben werden. Die Rückmeldung aus dem HVS32 erfolgt in den Export-Parametern. Die Kommunikation ist bidirektional, d.h. die Rückmeldung erfolgt synchron in der gleichen Transaktion wie die Anfrage.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die VersandDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSVERSANDDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    KUNDENNR CHAR(20)&lt;br /&gt;
    ZIELADRNAME1 CHAR(50)&lt;br /&gt;
    ZIELADRNAME2 CHAR(50)&lt;br /&gt;
    ZIELADRNAME3 CHAR(50)&lt;br /&gt;
    ZIELADRSTRASSE CHAR(50)&lt;br /&gt;
    ZIELADRLKZ CHAR(5)&lt;br /&gt;
    ZIELADRPLZ CHAR(10)&lt;br /&gt;
    ZIELADRORT CHAR(50)&lt;br /&gt;
    ZIELADRREGION CHAR(20)&lt;br /&gt;
    ZIELADRBAHNHOF CHAR(30)&lt;br /&gt;
    ANSPRECHPARTNER CHAR(20)&lt;br /&gt;
    TELEFONNR CHAR(20)&lt;br /&gt;
    FAXNR CHAR(20)&lt;br /&gt;
    USTIDNR CHAR(20)&lt;br /&gt;
    ILNNR CHAR(20)&lt;br /&gt;
    AUFTRAGGEBERID CHAR(10)&lt;br /&gt;
    VERSANDARTID CHAR(10)&lt;br /&gt;
    AVISHINWEIS1 CHAR(30)&lt;br /&gt;
    AVISHINWEIS2 CHAR(30)&lt;br /&gt;
    AVISZUSATZ1 CHAR(20)&lt;br /&gt;
    AVISZUSATZ2 CHAR(20)&lt;br /&gt;
    LIEFERSCHEINNR CHAR(40)&lt;br /&gt;
    AUFTRAGNR CHAR(20)&lt;br /&gt;
    BESTELLNR CHAR(20)&lt;br /&gt;
    WARENWERT CHAR(19)&lt;br /&gt;
    WWWAEHRUNG CHAR(3)&lt;br /&gt;
    NACHNAHME CHAR(19)&lt;br /&gt;
    NNWAEHRUNG CHAR(3)&lt;br /&gt;
    NNVERMERK CHAR(1)&lt;br /&gt;
    NNVERWENDUNG CHAR(30)&lt;br /&gt;
    VERSICHERUNGSWERT CHAR(19)&lt;br /&gt;
    VWWAEHRUNG CHAR(3)&lt;br /&gt;
    FRANKATURKENNUNG CHAR(10)&lt;br /&gt;
    ZAHLUNGSBEDIGNUNG CHAR(10)&lt;br /&gt;
    ZBZOLL CHAR(1)&lt;br /&gt;
    FRACHTFUEHRERKDNR CHAR(10)&lt;br /&gt;
    SONDERDIENSTE CHAR(30)&lt;br /&gt;
    SENDUNGSINHALT CHAR(30)&lt;br /&gt;
    TERMINART CHAR(1)&lt;br /&gt;
    TERMINDATUM CHAR(10)&lt;br /&gt;
    TERMINZEIT CHAR(5)&lt;br /&gt;
    NEUTABSENDERNAME1 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME2 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME3 CHAR(30)&lt;br /&gt;
    NEUTABSENDERSTRASSE CHAR(30)&lt;br /&gt;
    NEUTABSENDERLKZ CHAR(3)&lt;br /&gt;
    NEUTABSENDERPLZ CHAR(10)&lt;br /&gt;
    NEUTABSENDERORT CHAR(30)&lt;br /&gt;
    RECHNUNGSEMPFNAME1 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME2 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME3 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFSTRASSE CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFLKZ CHAR(5)&lt;br /&gt;
    RECHNUNGSEMPFPLZ CHAR(10)&lt;br /&gt;
    RECHNUNGSEMPFORT CHAR(50)&lt;br /&gt;
    POSTLEITCODE CHAR(15)&lt;br /&gt;
    POSTZIELFRACHTZENT CHAR(5)&lt;br /&gt;
    FRACHTBRIEF CHAR(20)&lt;br /&gt;
    GEWICHT CHAR(9)&lt;br /&gt;
    NETTOGEWICHT CHAR(9)&lt;br /&gt;
    PACKSTKGES CHAR(10)&lt;br /&gt;
    PACKSTKNR CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(6)&lt;br /&gt;
    PACKSTUECKLAENGE CHAR(10)&lt;br /&gt;
    PACKSTUECKBREITE CHAR(10)&lt;br /&gt;
    PACKSTUECKHOEHE CHAR(10)&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(15)&lt;br /&gt;
    ANZAHLARTIKEL CHAR(10)&lt;br /&gt;
    ZUSATZZEILE1 CHAR(150)&lt;br /&gt;
    ZUSATZZEILE2 CHAR(150)&lt;br /&gt;
    FREIAVIS1 CHAR(62)&lt;br /&gt;
    FREIAVIS2 CHAR(62)&lt;br /&gt;
    HVELEKTRONIKARTIKEL CHAR(1)&lt;br /&gt;
    EMPFEMAILADRESSE CHAR(100)&lt;br /&gt;
    KOSTENSTELLE CHAR(30)&lt;br /&gt;
    DRUCKERNAME CHAR(30)&lt;br /&gt;
  DGPOSITIONS STRUCTURE&lt;br /&gt;
    GEFAHRGUTUNNR CHAR(4)&lt;br /&gt;
    GEFAHRGUTKLASSE CHAR(6)&lt;br /&gt;
    GEFAHRGUTVPG CHAR(5)&lt;br /&gt;
    GEFAHRGUTKCODE CHAR(5)&lt;br /&gt;
    GEFAHRGUTBEZEICHNUNG CHAR(110)&lt;br /&gt;
    GEFAHRGUTMENGE CHAR(9)&lt;br /&gt;
    GEFAHRGUTBEGRENZTEMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTVERPANZAHL CHAR(10)&lt;br /&gt;
    GEFAHRGUTVERPACKUNGSART CHAR(8)&lt;br /&gt;
    GEFAHRGUTNEBENGEFAHR CHAR(20)&lt;br /&gt;
    GEFAHRGUTBUCHST640 CHAR(1)&lt;br /&gt;
    GEFAHRGUTMENGENEINHEIT CHAR(2)&lt;br /&gt;
    GEFAHRGUTBEFOERDKAT CHAR(10)&lt;br /&gt;
    GEFAHRGUTFAKTOR CHAR(10)&lt;br /&gt;
    GEFAHRGUTNETTOEXPLMASSE CHAR(9)&lt;br /&gt;
    GEFAHRGUTTUNNELBCODE CHAR(10)&lt;br /&gt;
    GEFAHRGUTFREIGESTMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTFFCODE CHAR(20)&lt;br /&gt;
  DELIVERYPOSITIONS STRUCTURE&lt;br /&gt;
    ANZAHLPOSETIKETTEN CHAR()&lt;br /&gt;
    ARTIKELBTNNR CHAR(25)&lt;br /&gt;
    ARTIKELEAN CHAR(20)&lt;br /&gt;
    ARTIKELEINHEIT CHAR(10)&lt;br /&gt;
    ARTIKELGEWICHT CHAR(9)&lt;br /&gt;
    ARTIKELMENGE CHAR(9)&lt;br /&gt;
    ARTIKELSOLLMENGE CHAR(9)&lt;br /&gt;
    ARTIKELTEXT1 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT2 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT3 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT4 CHAR(100)&lt;br /&gt;
    ARTIKELWAEHRUNG CHAR(3)&lt;br /&gt;
    ARTIKELWERT CHAR(9)&lt;br /&gt;
    CHARGEFLAG CHAR(1)&lt;br /&gt;
    KUNDENARTIKELNR CHAR(50)&lt;br /&gt;
    KUNDENBESTELLNR CHAR(50)&lt;br /&gt;
    POSAUFTRAGNR CHAR(50)&lt;br /&gt;
    POSITIONNR CHAR(40)&lt;br /&gt;
    POSLIEFERNR CHAR(40)&lt;br /&gt;
    SERIENNR CHAR(30)&lt;br /&gt;
    URSPRUNGLAND CHAR(2)&lt;br /&gt;
    ARTIKELGRUPPE CHAR(50)&lt;br /&gt;
    ARTIKELSERVICES CHAR(100)&lt;br /&gt;
    ARTIKELVOLUMEN CHAR(9)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    VERSANDSENDUNGSNR CHAR(20)&lt;br /&gt;
    DRUCKDATETIME CHAR(10)&lt;br /&gt;
    AUSGANGDATETIME CHAR(10)&lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die StatusDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;Z_STATUSDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(30)&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
    FEHLERCODE CHAR(1)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
    STATUSDATEN TABLE&lt;br /&gt;
      PACKSTUECKID CHAR(30)&lt;br /&gt;
      TRACKINGNR CHAR(35)&lt;br /&gt;
      EINTRAGDATETIME CHAR(20)&lt;br /&gt;
      EMPFANGSQUITTIERER CHAR(100)&lt;br /&gt;
      FEHLERSTATUS CHAR(2)&lt;br /&gt;
      FFSTATUSCODE CHAR(10)&lt;br /&gt;
      FFSTATUSKLARTEXT CHAR(250)&lt;br /&gt;
      FFZUSATZCODE CHAR(10)&lt;br /&gt;
      FFZUSATZKLARTEXT CHAR(120)&lt;br /&gt;
      STATUSDATETIME CHAR(20)&lt;br /&gt;
      STATUSORT CHAR(30)&lt;br /&gt;
      STATUSTYP CHAR(2)&lt;br /&gt;
      ZUSATZKLARTEXT CHAR(80)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_Automatik-Polling_Funktionen&amp;diff=6220</id>
		<title>HVS32 Automatik-Polling Funktionen</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_Automatik-Polling_Funktionen&amp;diff=6220"/>
		<updated>2025-12-05T14:19:46Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_automatic_polling_functions]]&lt;br /&gt;
= Datentypen =&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Integer&amp;#039;&amp;#039;&amp;#039; - Zahl mit ausschließlich numerischen Zeichen (0-9).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Decimal&amp;#039;&amp;#039;&amp;#039; - Zahl mit Nachkommastellen&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;String&amp;#039;&amp;#039;&amp;#039; - Beliebige Zeichen aus dem Zeichensatz ISO-8859-1. Maximale Länge darf nicht überschritten werden.&amp;lt;br&amp;gt;&lt;br /&gt;
= Zusätzliche Datentypen =&lt;br /&gt;
Zusätzliche Datentypen, welche in der Beschreibung vorkommen, stehen in einer 1:n Relation zu den Packstücken.&lt;br /&gt;
Bitte entnehmen Sie der jeweiligen Schnittstellen-Dokumentation des entsprechenden Plugins (File, JDBC, SAP, etc.), wie diese Relation realisiert werden muss.&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- ENDE ÜBERSICHT UNTERFUNKTIONEN ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- artikelDaten ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
== ArtikelDaten ==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
|Satz-Kennung&lt;br /&gt;
|[[#Datentypen|String]]&lt;br /&gt;
|3&lt;br /&gt;
| -&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Wird nur bei Datei Verabeitung benötigt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Satzkennung in der Polling Datei: &amp;quot;ART&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;--- ARTIKELDATEN-TEIL ---&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ANZAHLBUEGEL || [[#Datentypen|Integer]] || - || - || Nur für Hängeversand: Anzahl der Bügel auf welche die Artikelgruppe aufgeteilt ist&lt;br /&gt;
|-&lt;br /&gt;
| ANZAHLPOSETIKETTEN || [[#Datentypen|Integer]] || - || - || Anzahl Artikeletiketten, welche gedruckt werden sollen&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELBTNNR || [[#Datentypen|String]] || 25 || - || BTN Nummer / Zolltarifnummer&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELEAN || [[#Datentypen|String]] || 20 || - || EAN Nummer&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELEINHEIT || [[#Datentypen|String]] || 10 || - || Einheit der Artikelmenge&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELGEWICHT || [[#Datentypen|Decimal]] || 9 || 3 || Gewicht des Artikels in kg&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELGRUPPE || [[#Datentypen|String]] || 50 || - || Artikelgruppe&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELMENGE || [[#Datentypen|Decimal]] || 9 || 3 || Menge des Artikels&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELSERVICES || [[#Datentypen|String]] || 100 || - || Pipe getrennte Services für diesen Artikel&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELSOLLMENGE || [[#Datentypen|Decimal]] || 9 || 3 || -&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELTEXT1 || [[#Datentypen|String]] || 100 || - || Artikelbezeichnung&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELTEXT2 || [[#Datentypen|String]] || 100 || - || Artikelbezeichnung&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELTEXT3 || [[#Datentypen|String]] || 100 || - || Artikelbezeichnung&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELTEXT4 || [[#Datentypen|String]] || 100 || - || Artikelbezeichnung&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELVOLUMEN || [[#Datentypen|Decimal]] || 9 || 3 || Volumen des Artikels&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELWAEHRUNG || [[#Datentypen|String]] || 3 || - || Währung in welcher der Wert des Artikels angegeben wird&lt;br /&gt;
|-&lt;br /&gt;
| ARTIKELWERT || [[#Datentypen|Decimal]] || 18 || 2 || Wert des Artikels&lt;br /&gt;
|-&lt;br /&gt;
| CHARGEFLAG || [[#Datentypen|String]] || 1 || - || &lt;br /&gt;
|-&lt;br /&gt;
| KUNDENARTIKELNR || [[#Datentypen|String]] || 50 || - || Artikelnummer&lt;br /&gt;
|-&lt;br /&gt;
| KUNDENBESTELLNR || [[#Datentypen|String]] || 50 || - || Bestellnummer&lt;br /&gt;
|-&lt;br /&gt;
| POSAUFTRAGNR || [[#Datentypen|String]] || 50 || - || Auftragsnummer&lt;br /&gt;
|-&lt;br /&gt;
| POSLIEFERNR || [[#Datentypen|String]] || 40 || - || Lieferscheinnummer&lt;br /&gt;
|-&lt;br /&gt;
| POSITIONNR || [[#Datentypen|String]] || 50 || - || Laufende Nummer innerhalb des Packstücks&lt;br /&gt;
|-&lt;br /&gt;
| SERIENNR || [[#Datentypen|String]] || 30 || - || Seriennummer&lt;br /&gt;
|-&lt;br /&gt;
| URSPRUNGLAND || [[HVS32 Automatik-Polling Funktionen#Datentypen|String]] || 2 || - || Ursprungsland des Artikels&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- ENDE artikelDaten ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- gefahrgut ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gefahrgut ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In der Gefahrgut Abwicklung bieten wir zwei Möglichkeiten der Abwicklung an. Zum einen können die kompletten Gefahrgutdaten ans HVS32 übermittelt werden [[HVS32 Automatik-Polling Funktionen#Gefahrgut (aus den Positionsdaten)|(aus den Positionsdaten)]].&lt;br /&gt;
&lt;br /&gt;
Zum anderen gibt es die Möglichkeit, die Gefahrgutdaten ins HVS32 zu importieren und dort zu pflegen (siehe [[Verarbeitungsbeschreibung: Gefahrgut|Gefahrgutstamm]]). In diesem Fall müssen nicht alle Gefahrgutdaten ans HVS32 übermittelt werden, sondern werden aus dem im HVS32 hinterlegten Stamm ausgelesen. [[HVS32 Automatik-Polling Funktionen#Gefahrgut (über Gefahrgutstamm im HVS32)|(über Gefahrgutstamm im HVS32)]]&amp;lt;!--------------------------------------------------------------------------------- gefahrgut positionsdaten ---------------------------------------------------------------------------------&amp;gt;&lt;br /&gt;
===Gefahrgut (aus den Positionsdaten)===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
|Satz-Kennung&lt;br /&gt;
|[[#Datentypen|String]]&lt;br /&gt;
|3&lt;br /&gt;
| -&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Wird nur bei Datei Verabeitung benötigt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Satzkennung in der Polling Datei: &amp;quot;GEF&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;--- GEFAHRGUTDATEN-TEIL ---&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTBEFOERDKAT&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|Integer]] || 1 || - || Beförderungskategorie, Pflicht (siehe ADR-Tabelle Spalte (15)), kann 0-4 sein. Achtung! Muss unbedingt korrekt sein.&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTBEGRENZTEMENGE || [[#Datentypen|String]] || 1 || - || T wenn der Stoff mit Status LQ / Begrenzte Menge nach ADR 3.4 verschickt wird, ansonsten F, Pflicht&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTBEZEICHNUNG&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|String]] || 110 || - || Pflicht (siehe ADR-Tabelle Spalte (2))&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTBUCHST640 || [[#Datentypen|String]] || 1 || - || Buchstabe für Sondervorschrift 640, bedingte Pflicht bei Stoffen, bei denen die Sondervorschrift 640 gilt (siehe ADR-Tabelle Spalte (6))&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTFFCODE || [[#Datentypen|String]] || &amp;lt;!-- MAXLÄNGE --&amp;gt; || &amp;lt;!-- DEZ --&amp;gt; || &amp;lt;!-- BELEGUNG --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTFAKTOR || [[#Datentypen|Integer]] || 3 || - || Bewertungsfaktor für Punktesummation auf dem Beförderungspapier,  (kann 0, 1, 3, 50 oder 999 sein), eigentlich Pflicht, kann aber eindeutig aus der Beförderungskategorie geschlossen werden, daher muss es nicht unbedingt belegt sein&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTFREIGESTMENGE || [[#Datentypen|String]] || 1 || - || T wenn der Stoff mit Status EQ / Excepted Quantities nach ADR 3.5 verschickt wird, ansonsten F, Pflicht&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTID || [[#Datentypen|String]] || 20 || - || Eindeutige Suchnummer für Gefahrgut-Stammdaten&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTKCODE || [[#Datentypen|String]] || 10 || - || Klassifizierungscode, Pflicht (siehe ADR-Tabelle Spalte (3b))&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTKLASSE&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|String]] || 100 || - || Pflicht (siehe ADR-Tabelle Spalte (3a))&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTMENGE&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|Decimal]] || 8 || 3 || Stoff-Menge an Gefahrgut, die ADR-technisch zu deklarieren ist ( in Litern bei Flüssigkeiten und verdichteten Gasen, sonst in kg, bei LQ-Gefahrgut immer kg )&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTMENGENEINHEIT&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|String]] || 2 || - || Mengeneinheit zur Stoff-Menge. ‚1‘ oder ‚l‘: Liter ; ‚0‘ oder ‚kg‘ oder leer: kg&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTNEBENGEFAHR || [[#Datentypen|String]] || 10 || - || bedingte Pflicht bei Stoffen, bei denen neben der Hauptgefahr-Klasse/Zettelnummer noch Nebengefahr-Zettelnummern vorhanden sind (siehe ADR-Tabelle Spalte (5), wenn dort z.B. 3+6.1+8 eingetragen ist, sind 6.1 und 8 die Nebengefahr-Zettelnummern und als (6.1)(8) im Feld Nebengefahr zu übermitteln )&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTNETTOEXPLMASSE || [[#Datentypen|Decimal]] || 8 || 3 || Netto-Explosivmasse in kg, nur bei Gefahrgütern der Klasse 1&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTPOSITIONNR || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTTECHBENENNUNG || [[#Datentypen|String]] || 150 || - || bedingt Pflicht bei N.A.G. Gefahrgut (d.h. wenn die Bezeichnung mit N.A.G. endet)&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTTUNNELBCODE || [[#Datentypen|String]] || 10 || - || Tunnelbeschränkungscode, Pflicht (siehe ADR-Tabelle Spalte (15))&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTUNNR&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|String]] || 10 || - || Pflicht (siehe ADR-Tabelle Spalte (1))&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTUMWELTGEF || [[#Datentypen|String]] || 1 || - || T wenn Stoff umweltgefährdend ist , ansonsten F, Pflicht bei umweltgefährdenden Stoffen&lt;br /&gt;
|-&lt;br /&gt;
| GEFAHRGUTVPG || [[#Datentypen|String]] || 3 || - || Verpackungsgruppe, bedingt Pflicht bei den Stoffen, bei denen diese in der ADR-Tabelle belegt ist, kann I,II oder III sein oder gar nicht belegt (letzteres z.B. bei Klasse 2)) (siehe ADR-Tabelle Spalte (4))&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTVERPANZAHL&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|Integer]] || 4 || - || Anzahl der Einheiten, in denen das Gefahrgut verpackt ist (in Zusammenhang mit dem nächsten Feld GefahrgutVerpackungsart)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEFAHRGUTVERPACKUNGSART&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|String]] || 5 || - || ADR-Code der Verpackungsart, z.B. 4G für Kiste (Pappe), Pflicht, siehe separate Doc f. Verpackungscodes&lt;br /&gt;
|}&lt;br /&gt;
===Gefahrgut (über [[Verarbeitungsbeschreibung: Gefahrgut|Gefahrgutstamm im HVS32]])===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Feldname !!Typ!!Max Länge!! Dezimalstellen!!Belegung&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;GefahrgutID&amp;#039;&amp;#039;&amp;#039;||[[HVS32 Automatik-Polling Funktionen#Datentypen|String]]||20||- ||Eindeutige Suchnummer für Gefahrgut-Stammdaten&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;GefahrgutMenge&amp;#039;&amp;#039;&amp;#039;||[[HVS32 Automatik-Polling Funktionen#Datentypen|Decimal]]||8||3||-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;GefahrgutVerpAnzahl&amp;#039;&amp;#039;&amp;#039;||[[HVS32 Automatik-Polling Funktionen#Datentypen|Integer]]||-||-||-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;GefahrgutMengenEinheit&amp;#039;&amp;#039;&amp;#039;||[[HVS32 Automatik-Polling Funktionen#Datentypen|String]]||2||- ||&amp;#039;0&amp;#039; bzw Blank: Kilogramm; &amp;#039;1&amp;#039;: Liter&lt;br /&gt;
|-&lt;br /&gt;
|GefahrgutNettoExplMasse ||[[HVS32 Automatik-Polling Funktionen#Datentypen|Decimal]]||8||3 ||Nur bei Klasse 1, dann aber Pflicht&lt;br /&gt;
|}&amp;lt;!-- ------------------------------------------------------------------------------- ENDE gefahrgut ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Packstück-Verarbeitung (VersandDatenAnfrage) =&lt;br /&gt;
Die Gatewayfunktion VersandDatenAnfrage wird vom Data-Gateway-Server im Automatik-Polling Modus an das HVS32 gesendet, um dort ein Etikett für ein Packstück zu erzeugen und verbuchen.&lt;br /&gt;
Ein Etikett wird für alle weiteren Funktionen wir Storno, Verladefreigabe, etc. anhand der hostseitigen Packstück-ID identifiziert. Diese wird im Feld PackstueckID übergeben und muss dementsprechend innerhalb des Versandsystems eindeutig sein.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Durch eine zusätzliche Konfiguration im HVS32 kann die VersandDatenAnfrage auch dazu verwendet werden, um einen Nachdruck anzustoßen. Dabei muss bei der erneuten Anfrage die selbe PackstueckID verwendet werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| ANSPRECHPARTNER || [[#Datentypen|String]] || 50 || - || Empfänger Ansprechpartner&lt;br /&gt;
|-&lt;br /&gt;
| ANZAHLARTIKEL || [[#Datentypen|Integer]] || 6 || - || Anzahl Artikel (Druck auf Etikett)&lt;br /&gt;
|-&lt;br /&gt;
| [[#ArtikelDaten|ARTIKELDATEN]] || [[#Datentypen|Sequence]] &amp;#039;&amp;#039;&amp;#039;[[#ArtikelDaten|&amp;lt;ArtikelDaten&amp;gt;]]&amp;#039;&amp;#039;&amp;#039; || - || - || Eine Liste der [[#ArtikelDaten|Packstück-Artikel]] vom Typ &amp;#039;&amp;#039;&amp;#039;[[#ArtikelDaten|ArtikelDaten]]&amp;#039;&amp;#039;&amp;#039; (1:n)&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGNR || [[#Datentypen|String]] || 20 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;AUFTRAGGEBERID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Mandantenkennung aus dem HVS32&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS1 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS2 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ1 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 1&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ2 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 2&lt;br /&gt;
|-&lt;br /&gt;
| BARCODEID || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BARCODETEXT || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BARCODETYP || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BESTELLNR || [[#Datentypen|String]] || 20 || - || Metro-Bestellnr (Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKERNAME || [[#Datentypen|String]] || 30 || - || Name eines Ausgabekanals (Drucker) im HVS32 über den das Etikett gedruckt wird. (Benötigt Druckerspooler Erweiterungsmodul)&lt;br /&gt;
|-&lt;br /&gt;
| EMAIL || [[#Datentypen|String]] || 100 || - || E-Mail Adresse des Empfängers (z.B.: für die Automatische E-Mail Avisierung)&lt;br /&gt;
|-&lt;br /&gt;
| EMPFMOBILFUNKNR || [[#Datentypen|String]] || 20 || - || Mobilfunknummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FAXNR || [[#Datentypen|String]] || 20 || - || Faxnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FLEXZUSTELLUNGEMAILADRESSE || [[#Datentypen|String]] || 80 || - || Flex-Zustellung Emailadresse&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTBRIEF || [[#Datentypen|String]] || 20 || - || Frachtbrief Nummer falls Frachtbrief durch Vorsystem gedruckt werden soll&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTFUEHRERKDNR || [[#Datentypen|String]] || 10 || - || Kundennummer des Frachtzahlers beim Frachtführer&lt;br /&gt;
|-&lt;br /&gt;
| FRANKATURKENNUNG || [[#Datentypen|String]] || 10 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| [[#Gefahrgut|GEFAHRGUT]] || [[#Datentypen|Sequence]] &amp;#039;&amp;#039;&amp;#039;[[#Gefahrgut|&amp;lt;Gefahrgut&amp;gt;]]&amp;#039;&amp;#039;&amp;#039; || - || - || Eine Liste der [[#Gefahrgut|Gefahrgüter]] vom Typ &amp;#039;&amp;#039;&amp;#039;[[#Gefahrgut|Gefahrgut]]&amp;#039;&amp;#039;&amp;#039; (1:n)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEWICHT&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|Decimal]] || 8 || 3 || Bruttogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| HOSTTRACKINGNR || [[#Datentypen|String]] || 35 || - || Paketnummer aus dem Hostsystem&lt;br /&gt;
|-&lt;br /&gt;
| ILNNR || [[#Datentypen|String]] || 20 || - || ILN des Empfängers (Pflicht bei Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| KOSTENSTELLE || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| KUNDENNR || [[#Datentypen|String]] || 20 || - || Kundennummer des Empfängers beim Versender&lt;br /&gt;
|-&lt;br /&gt;
| LAGERKENNZEICHEN || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| LETZTESPACKSTUECK || [[#Datentypen|String]] || 1 || - || T/F: T=letztes Packstüeck der Sendung (wird bei Hängeversand zum Drucken der Sendungs-Hängekarte benötigt)&lt;br /&gt;
|-&lt;br /&gt;
| LIEFERANTENID || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;LIEFERSCHEINNR&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 40 || - || Wird im HVS32 als Such-Nummer verwendet&lt;br /&gt;
|-&lt;br /&gt;
| NACHNAHME || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| NETTOGEWICHT || [[#Datentypen|Decimal]] || 8 || 3 || Nettogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| NEUTBIC || [[#Datentypen|String]] || 11 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTBANKBEZEICHNUNG || [[#Datentypen|String]] || 40 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTIBAN || [[#Datentypen|String]] || 31 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTKONTOINHABER || [[#Datentypen|String]] || 40 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERLKZ || [[#Datentypen|String]] || 3 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME1 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME2 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME3 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERORT || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERPLZ || [[#Datentypen|String]] || 10 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERSTRASSE || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NNVERMERK || [[#Datentypen|String]] || 1 || - || &amp;#039;B&amp;#039;: Bar / &amp;#039;V&amp;#039;: Verrechnungsscheck&lt;br /&gt;
|-&lt;br /&gt;
| NNVERWENDUNG || [[#Datentypen|String]] || 30 || - || Nachnahme Verwendungszweck&lt;br /&gt;
|-&lt;br /&gt;
| NNWAEHRUNG || [[#Datentypen|String]] || 3 || - || Nachnahme - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTKGES&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|Integer]] || - || - || Gesamt-Anzahl Colli der Sendung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTKNR&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|Integer]] || - || - || Laufende Nr pro Sendung&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeiten soll.&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKBREITE || [[#Datentypen|Integer]] || - || - || Breite in cm&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKHOEHE || [[#Datentypen|Integer]] || - || - || Höhe in cm&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTUECKID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 20 || - || Eindeutige Nummer für das Paket im Vorsystem. Wird als eindeutige Paketreferenz benötigt um das Etikett später zu stornieren oder zu Verladen.&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKLAENGE || [[#Datentypen|Integer]] || - || - || Länge in cm&lt;br /&gt;
|-&lt;br /&gt;
| PAPERLESSINVOICE || [[#Datentypen|String]] || 1 || - || Nur im UPS PaperlessInvoice Fall (T=PaperlessInvoice / F=nicht PaperlessInvoice)&lt;br /&gt;
|-&lt;br /&gt;
| POSTLEITCODE || [[#Datentypen|String]] || 15 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| POSTZIELFRACHTZENT || [[#Datentypen|String]] || 5 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFLKZ || [[#Datentypen|String]] || 5 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME1 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME2 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME3 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFORT || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFPLZ || [[#Datentypen|String]] || 10 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFSTRASSE || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSNR || [[#Datentypen|String]] || 20 || - || Rechnungsnummer&lt;br /&gt;
|-&lt;br /&gt;
| SENDUNGSINHALT || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| SONDERDIENSTE || [[#Datentypen|String]] || 30 || - || Versandart-spezifisch belegt&lt;br /&gt;
|-&lt;br /&gt;
| SPERRFLAG || [[#Datentypen|String]] || 1 || - || T/F: T=Sperren, sonst nicht sperren&lt;br /&gt;
|-&lt;br /&gt;
| TELEFONNR || [[#Datentypen|String]] || 20 || - || Telefonnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| TERMINART || [[#Datentypen|String]] || 1 || - || &amp;#039;A&amp;#039; = ab diesem Tag liefern&lt;br /&gt;
&amp;#039;B&amp;#039; = bis zu diesem Tag liefern&lt;br /&gt;
&lt;br /&gt;
&amp;#039;F&amp;#039; = an diesem Tag liefern&lt;br /&gt;
|-&lt;br /&gt;
| TERMINDATUM || [[#Datentypen|String]] || 10 || - || TT.MM.JJJJ&lt;br /&gt;
|-&lt;br /&gt;
| TERMINZEIT || [[#Datentypen|Calendar]] || 5 || - || HH:MM&lt;br /&gt;
|-&lt;br /&gt;
| USTIDNR || [[#Datentypen|String]] || 20 || - || UmsatzsteuerNr des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| VERPACKUNGSART || [[#Datentypen|String]] || 6 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;VERSANDARTID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Versandartkennung aus dem HVS32&lt;br /&gt;
|-&lt;br /&gt;
| VERSICHERUNGSWERT || [[#Datentypen|Decimal]] || 18 || 2 || Höhe Versicherungswert&lt;br /&gt;
|-&lt;br /&gt;
| VORPACKDATUM || [[#Datentypen|String]] || 10 || - || TT.MM.JJJJ&lt;br /&gt;
|-&lt;br /&gt;
| VWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Versicherungswert - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| WARENWERT || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Wechselbrücke, die diesem Packstück zugewiesen wird&lt;br /&gt;
|-&lt;br /&gt;
| WWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Warenwert - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| ZAHLUNGSBEDINGUNG || [[#Datentypen|String]] || 10 || - || &amp;#039;S&amp;#039; = Sender, &amp;#039;R&amp;#039; = Empfänger&lt;br /&gt;
|-&lt;br /&gt;
| ZBZOLL || [[#Datentypen|String]] || 1 || - || Zahlungsbedingung für Zoll Steuern &amp;#039;S&amp;#039; = Sender, &amp;#039;R&amp;#039; = Empfänger&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRBAHNHOF || [[#Datentypen|String]] || 30 || - || PLZ und Ort&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRLKZ&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 5 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRNAME1&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME2 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME3 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME4 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRORT&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRPLZ&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRREGION || [[#Datentypen|String]] || 20 || - || Staat/Provinz (z.B.: für Sendungen in die USA wichtig)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRSTRASSE&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung|&lt;br /&gt;
|-&lt;br /&gt;
| AUSGANGDATETIME || [[#Datentypen|String]] || 10 || - || Datum, wann das Etikett an den Frachtführer übermittelt worden ist (TT.MM.JJJJ)&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKDATETIME || [[#Datentypen|String]] || 19 || - || Datum, wann das Etikett im HVS32 gedruckt worden ist (TT.MM.JJJJ HH:mm:SS)&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 wenn Erfolgreich&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || Wird im Fehlerfall befüllt&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || Wird im Fehlerfall befüllt&lt;br /&gt;
|-&lt;br /&gt;
| GEBUEHR || [[#Datentypen|Decimal]] || 18 || 2 || Frachtkosten&lt;br /&gt;
|-&lt;br /&gt;
| GEBUEHRWAEHRUNG || [[#Datentypen|String]] || 3 || - || Frachkosten ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || PackstueckID aus der Anfrage&lt;br /&gt;
|-&lt;br /&gt;
| RETOURTRACKINGNR || [[#Datentypen|String]] || 50 || - || Paketnummer für die Retoure&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || Paketnummer&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGURL || [[#Datentypen|String]] || 255 || - || URL des Trackinglinks zur Sendungsverfolgung&lt;br /&gt;
|-&lt;br /&gt;
| VERSANDSENDUNGSNR || [[#Datentypen|String]] || - || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Etikett nachdrucken (VersandDatenWdhDruck) =&lt;br /&gt;
Die Gatewayfunktion VersandDatenWdhDruck wird vom Data-Gateway-Server im Automatik-Polling Modus an das HVS32 gesendet, um dort ein Etikett für ein Packstück nachzudrucken.&lt;br /&gt;
Ein Etikett wird anhand der hostseitigen Packstück-ID nachgedruckt. Diese wird im Feld PackstueckID übergeben.&lt;br /&gt;
Bei manchen Frachtführern (z.B. DPD) werden beim Nachdruck neue Trackingnummern vergeben. Somit ist die alte Trackingnummer nicht mehr gültig und das alte Versandetikett muss vernichtet werden.&lt;br /&gt;
Die neue Trackingnummer kann in der Rückmeldung zurückgemeldet werden.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTUECKID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 20 || - || &amp;#039;&amp;#039;&amp;#039;Eindeutige&amp;#039;&amp;#039;&amp;#039; Nummer für das Paket im Vorsystem.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeiten soll.&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKERNAME || [[#Datentypen|String]] || 30 || - || Ausgabekanal, an welchem das Etikett nachgedruckt werden soll (benötigt HVS32 Erweiterungsmodul &amp;quot;Druckerspooler&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || (neue) TrackingNr des Packstücks&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstück stornieren (StornoVersandDaten) =&lt;br /&gt;
Die Gatewayfunktion StornoVersandDaten wird vom Data-Gateway-Server im Automatik-Polling Modus an das HVS32 gesendet, um dort bestehende Packstücke zu stornieren, die noch nicht auf einer Ausgangsliste sind.&lt;br /&gt;
In der Regel wird ein Packstück anhand der hostseitigen Packstück-ID storniert. Diese wird im Feld PackstueckID übergeben.&lt;br /&gt;
Zusätzlich zur hostseitigen Packstück-ID kann auch die TrackingNr zur Identifikation des Packstücks beitragen, für den Fall, dass die hostseitige Packstück-ID keine Eindeutigkeit garantieren kann.&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreichem Storno wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTUECKID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 20 || - || &amp;#039;&amp;#039;&amp;#039;Eindeutige&amp;#039;&amp;#039;&amp;#039; Nummer für das Paket im Vorsystem.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeiten soll.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstück verladen/freigeben (VerladeVersandDaten) =&lt;br /&gt;
Die Gatewayfunktion VerladeVersandDaten wird vom Data-Gateway-Server im Automatik-Polling Modus an das HVS32 gesendet, um dort Packstücke für den Ausgang frei zu geben.&lt;br /&gt;
Nur Packstücke, welche für den Ausgang freigegeben wurden, werden für den Tagesabschluss berücksichtigt.&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreicher Freigabe wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTUECKID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 20 || - || &amp;#039;&amp;#039;&amp;#039;Eindeutige&amp;#039;&amp;#039;&amp;#039; Nummer für das Paket im Vorsystem.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeiten soll.&lt;br /&gt;
|-&lt;br /&gt;
| SPERRKENNZEICHEN || [[#Datentypen|String]] || 1 || - || &amp;quot;J&amp;quot; wenn das Packstück gesperrt werden soll&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Wechselbrücke auf welche das Packstück gebucht werden soll&lt;br /&gt;
|-&lt;br /&gt;
| SAMMELFREIGABE || [[#Datentypen|String]] || 1 || - || &amp;quot;T&amp;quot; bei einer Sammel-Freigabe (Alle Packstücke mit identischer VE-ReferenzNr freigeben)&lt;br /&gt;
|-&lt;br /&gt;
| VEREFERENZNR || [[#Datentypen|String]] || 20 || - || muss bei einer Sammel-Freigabe gefüllt sein&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tagesabschluss (Tagesabschluss) =&lt;br /&gt;
Das Gateway sendet die Tagesabschluss-Anfrage an das Automatik-Polling des HVS32. Im HVS32 wird somit ein Tagesabschluss anhand der zusätzlich übergebenen Parameter ausgelöst.&lt;br /&gt;
Der Tagesabschluss setzt sich aus den Punkten Ausgangsliste erzeugen und Frachtführer DFÜ erzeugen zusammen.&lt;br /&gt;
Nur Packstücke, welche für den Ausgang freigegeben wurden, werden für den Tagesabschluss berücksichtigt. Standardmäßig sind alle Packstücke freigegeben, außer sie wurden durch das Erweiterungsmodul Ausgangsscannung gesperrt.&lt;br /&gt;
Die Rückmeldung im HVS32 findet nach dem Ausführen des Tagesabschluss statt.&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreichem Tagesabschluss wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Tagesabschluss ausführen soll.&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTFUEHRERTYPLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Frachführern mitgegeben werden. Es können n-Frachtführer abgeschlossen werden.&lt;br /&gt;
(Option MultiFFTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGGEBERIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Auftraggebern mitgegeben werden. Es können n-Auftraggeber abgeschlossen werden.&lt;br /&gt;
(Option MultiAGTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| VERSANDARTIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Versandarten mitgegeben werden. Es können n-Versandarten abgeschlossen werden.&lt;br /&gt;
(Option MultiVATagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Kennzeichen der abzuschließenden Wechselbrücke. Hiermit können nur bestimmte Sendungen abgeschlossen werden.&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKERNAME || [[#Datentypen|String]] || 30 || - || Name des Ausgabekanals auf welchem die Liste gedruckt werden soll&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Ausgangsliste erzeugen (Listenabschluss) =&lt;br /&gt;
Das Gateway sendet die Listenabschluss-Anfrage an das Automatik-Polling des HVS32. Im HVS32 wird somit eine Ausgangsliste anhand der zusätzlich übergebenen Parameter erzeugt.&lt;br /&gt;
Nur Packstücke, welche für den Ausgang freigegeben wurden, werden für den Listenabschluss berücksichtigt. Standardmäßig sind alle Packstücke freigegeben, außer sie wurden durch das Erweiterungsmodul Ausgangsscannung gesperrt.&lt;br /&gt;
Die Rückmeldung im HVS32 findet nach dem Erzeugen der Ausgangsliste statt.&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreichem Listenabschluss wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Tagesabschluss ausführen soll.&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTFUEHRERTYPLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Frachführern mitgegeben werden. Es können n-Frachtführer abgeschlossen werden.&lt;br /&gt;
(Option MultiFFTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGGEBERIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Auftraggebern mitgegeben werden. Es können n-Auftraggeber abgeschlossen werden.&lt;br /&gt;
(Option MultiAGTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| VERSANDARTIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Versandarten mitgegeben werden. Es können n-Versandarten abgeschlossen werden.&lt;br /&gt;
(Option MultiVATagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Kennzeichen der abzuschließenden Wechselbrücke. Hiermit können nur bestimmte Sendungen abgeschlossen werden.&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKERNAME || [[#Datentypen|String]] || 30 || - || Name des Ausgabekanals auf welchem die Liste gedruckt werden soll&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Frachtführer DFÜ erzeugen (EDIAbschluss) =&lt;br /&gt;
Das Gateway sendet die EDIAbschluss-Anfrage an das Automatik-Polling des HVS32. Im HVS32 wird somit eine Frachtführer DFÜ anhand der zusätzlich übergebenen Parameter erzeugt und (falls konfiguriert) an den Frachtführer übertragen.&lt;br /&gt;
Nur Packstücke, für welche zuvor eine Ausgangsliste erzeugt wurde, werden für eine Frachtführer DFÜ berücksichtigt.&lt;br /&gt;
Die Rückmeldung im HVS32 findet nach dem Erzeugen der Frachtführer DFÜ statt.&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreichem EDIAbschluss wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Tagesabschluss ausführen soll.&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTFUEHRERTYPLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Frachführern mitgegeben werden. Es können n-Frachtführer abgeschlossen werden.&lt;br /&gt;
(Option MultiFFTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGGEBERIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Auftraggebern mitgegeben werden. Es können n-Auftraggeber abgeschlossen werden.&lt;br /&gt;
(Option MultiAGTagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| VERSANDARTIDLIST || [[#Datentypen|String]] || 250 || - || Hier kann eine Semikolon separierte Liste mit den abzuschließenden Versandarten mitgegeben werden. Es können n-Versandarten abgeschlossen werden.&lt;br /&gt;
(Option MultiVATagesabschluss muss im HVS32 aktiv sein)&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Kennzeichen der abzuschließenden Wechselbrücke. Hiermit können nur bestimmte Sendungen abgeschlossen werden.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstückdaten prüfen (VersandDatenPruefAnfrage) =&lt;br /&gt;
Das Gateway sendet die VersandDatenPruefAnfrage an das Automatik-Polling des HVS32. Im HVS32 wird somit eine VersandDatenAnfrage simuliert.&lt;br /&gt;
Dabei werden keine Etiketten gedruckt und das Packstück bzw. das Etikett wird nicht verbucht, jedoch sind alle weiteren Prozesse identisch zur VersandDatenAnfrage (Routenermittlung, Trackingnummer-Ermittlung, Adressprüfung, etc.)&lt;br /&gt;
Diese Funktion dient dazu im Vorfeld alle Versand-Daten zu validieren.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| ANSPRECHPARTNER || [[#Datentypen|String]] || 50 || - || Empfänger Ansprechpartner&lt;br /&gt;
|-&lt;br /&gt;
| ANZAHLARTIKEL || [[#Datentypen|Integer]] || 6 || - || Anzahl Artikel (Druck auf Etikett)&lt;br /&gt;
|-&lt;br /&gt;
| [[#ArtikelDaten|ARTIKELDATEN]] || [[#Datentypen|Sequence]] &amp;#039;&amp;#039;&amp;#039;[[#ArtikelDaten|&amp;lt;ArtikelDaten&amp;gt;]]&amp;#039;&amp;#039;&amp;#039; || - || - || Eine Liste der [[#ArtikelDaten|Packstück-Artikel]] vom Typ &amp;#039;&amp;#039;&amp;#039;[[#ArtikelDaten|ArtikelDaten]]&amp;#039;&amp;#039;&amp;#039; (1:n)&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGNR || [[#Datentypen|String]] || 20 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;AUFTRAGGEBERID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Mandantenkennung aus dem HVS32&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS1 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS2 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ1 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 1&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ2 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 2&lt;br /&gt;
|-&lt;br /&gt;
| BARCODEID || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BARCODETEXT || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BARCODETYP || [[#Datentypen|String]] || - || - || Zusatzfeld für evtl. Erweiterungen&lt;br /&gt;
|-&lt;br /&gt;
| BESTELLNR || [[#Datentypen|String]] || 20 || - || Metro-Bestellnr (Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| DRUCKERNAME || [[#Datentypen|String]] || 30 || - || Name eines Ausgabekanals (Drucker) im HVS32 über den das Etikett gedruckt wird. (Benötigt Druckerspooler Erweiterungsmodul)&lt;br /&gt;
|-&lt;br /&gt;
| EMAIL || [[#Datentypen|String]] || 100 || - || E-Mail Adresse des Empfängers (z.B.: für die Automatische E-Mail Avisierung)&lt;br /&gt;
|-&lt;br /&gt;
| EMPFMOBILFUNKNR || [[#Datentypen|String]] || 20 || - || Mobilfunknummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FAXNR || [[#Datentypen|String]] || 20 || - || Faxnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FLEXZUSTELLUNGEMAILADRESSE || [[#Datentypen|String]] || 80 || - || Flex-Zustellung Emailadresse&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTBRIEF || [[#Datentypen|String]] || 20 || - || Frachtbrief Nummer falls Frachtbrief durch Vorsystem gedruckt werden soll&lt;br /&gt;
|-&lt;br /&gt;
| FRACHTFUEHRERKDNR || [[#Datentypen|String]] || 10 || - || Kundennummer des Frachtzahlers beim Frachtführer&lt;br /&gt;
|-&lt;br /&gt;
| FRANKATURKENNUNG || [[#Datentypen|String]] || 10 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| [[#Gefahrgut|GEFAHRGUT]] || [[#Datentypen|Sequence]] &amp;#039;&amp;#039;&amp;#039;[[#Gefahrgut|&amp;lt;Gefahrgut&amp;gt;]]&amp;#039;&amp;#039;&amp;#039; || - || - || Eine Liste der [[#Gefahrgut|Gefahrgüter]] vom Typ &amp;#039;&amp;#039;&amp;#039;[[#Gefahrgut|Gefahrgut]]&amp;#039;&amp;#039;&amp;#039; (1:n)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;GEWICHT&amp;#039;&amp;#039;&amp;#039; ||[[#Datentypen|Decimal]] || 8 || 3 || Bruttogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| HOSTTRACKINGNR || [[#Datentypen|String]] || 35 || - || Paketnummer aus dem Hostsystem&lt;br /&gt;
|-&lt;br /&gt;
| ILNNR || [[#Datentypen|String]] || 20 || - || ILN des Empfängers (Pflicht bei Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| KOSTENSTELLE || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| KUNDENNR || [[#Datentypen|String]] || 20 || - || Kundennummer des Empfängers beim Versender&lt;br /&gt;
|-&lt;br /&gt;
| LAGERKENNZEICHEN || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| LETZTESPACKSTUECK || [[#Datentypen|String]] || 1 || - || T/F: T=letztes Packstüeck der Sendung (wird bei Hängeversand zum Drucken der Sendungs-Hängekarte benötigt)&lt;br /&gt;
|-&lt;br /&gt;
| LIEFERANTENID || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;LIEFERSCHEINNR&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 40 || - || Wird im HVS32 als Such-Nummer verwendet&lt;br /&gt;
|-&lt;br /&gt;
| NACHNAHME || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| NETTOGEWICHT || [[#Datentypen|Decimal]] || 8 || 3 || Nettogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| NEUTBIC || [[#Datentypen|String]] || 11 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTBANKBEZEICHNUNG || [[#Datentypen|String]] || 40 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTIBAN || [[#Datentypen|String]] || 31 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTKONTOINHABER || [[#Datentypen|String]] || 40 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERLKZ || [[#Datentypen|String]] || 3 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME1 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME2 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERNAME3 || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERORT || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERPLZ || [[#Datentypen|String]] || 10 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NEUTABSENDERSTRASSE || [[#Datentypen|String]] || 50 || - || Nur bei Neutral-Absendern belegt&lt;br /&gt;
|-&lt;br /&gt;
| NNVERMERK || [[#Datentypen|String]] || 1 || - || B&amp;#039;: Bar / &amp;#039;V&amp;#039;: Verrechnungsscheck&lt;br /&gt;
|-&lt;br /&gt;
| NNVERWENDUNG || [[#Datentypen|String]] || 30 || - || Nachnahme Verwendungszweck&lt;br /&gt;
|-&lt;br /&gt;
| NNWAEHRUNG || [[#Datentypen|String]] || 3 || - || Nachnahme - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTKGES&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|Integer]] || - || - || Gesamt-Anzahl Colli der Sendung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTKNR&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|Integer]] || - || - || Laufende Nr pro Sendung&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeten soll.&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKBREITE || [[#Datentypen|Integer]] || - || - || Breite in cm&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKHOEHE || [[#Datentypen|Integer]] || - || - || Höhe in cm&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || Eindeutige Nummer für das Paket im Vorsystem. Wird als eindeutige Paketreferenz benötigt um das Etikett später zu stornieren oder zu Verladen.&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKLAENGE || [[#Datentypen|Integer]] || - || - || Länge in cm&lt;br /&gt;
|-&lt;br /&gt;
| PAPERLESSINVOICE || [[#Datentypen|String]] || 1 || - || Nur im UPS PaperlessInvoice Fall (T=PaperlessInvoice / F=nicht PaperlessInvoice)&lt;br /&gt;
|-&lt;br /&gt;
| POSTLEITCODE || [[#Datentypen|String]] || 15 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| POSTZIELFRACHTZENT || [[#Datentypen|String]] || 5 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFLKZ || [[#Datentypen|String]] || 5 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME1 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME2 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME3 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFORT || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFPLZ || [[#Datentypen|String]] || 10 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFSTRASSE || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSNR || [[#Datentypen|String]] || 20 || - || Rechnungsnummer&lt;br /&gt;
|-&lt;br /&gt;
| SENDUNGSINHALT || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| SONDERDIENSTE || [[#Datentypen|String]] || 30 || - || Versandart-spezifisch belegt&lt;br /&gt;
|-&lt;br /&gt;
| SPERRFLAG || [[#Datentypen|String]] || 1 || - || T/F: T=Sperren, sonst nicht sperren&lt;br /&gt;
|-&lt;br /&gt;
| TELEFONNR || [[#Datentypen|String]] || 20 || - || Telefonnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| TERMINART || [[#Datentypen|String]] || 1 || - || &amp;#039;A&amp;#039;b / &amp;#039;B&amp;#039;is / &amp;#039;F&amp;#039;ix&lt;br /&gt;
|-&lt;br /&gt;
| TERMINDATUM || [[#Datentypen|String]] || 10 || - || TT.MM.JJJJ&lt;br /&gt;
|-&lt;br /&gt;
| TERMINZEIT || [[#Datentypen|Calendar]] || 5 || - || HH:MM&lt;br /&gt;
|-&lt;br /&gt;
| USTIDNR || [[#Datentypen|String]] || 20 || - || UmsatzsteuerNr des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| VERPACKUNGSART || [[#Datentypen|String]] || 6 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;VERSANDARTID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Versandartkennung aus dem HVS32&lt;br /&gt;
|-&lt;br /&gt;
| VERSICHERUNGSWERT || [[#Datentypen|Decimal]] || 18 || 2 || Höhe Versicherungswert&lt;br /&gt;
|-&lt;br /&gt;
| VORPACKDATUM || [[#Datentypen|String]] || 10 || - || TT.MM.JJJJ&lt;br /&gt;
|-&lt;br /&gt;
| VWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Versicherungswert - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| WARENWERT || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Wechselbrücke, die diesem Packstück zugewiesen wird&lt;br /&gt;
|-&lt;br /&gt;
| WWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Warenwert - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| ZAHLUNGSBEDINGUNG || [[#Datentypen|String]] || 10 || - || &amp;#039;S&amp;#039; = Sender, &amp;#039;R&amp;#039; = Empfänger&lt;br /&gt;
|-&lt;br /&gt;
| ZBZOLL || [[#Datentypen|String]] || 1 || - || Zahlungsbedingung für Zoll Steuern &amp;#039;S&amp;#039; = Sender, &amp;#039;R&amp;#039; = Empfänger&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRBAHNHOF || [[#Datentypen|String]] || 30 || - || PLZ und Ort&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRLKZ&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 5 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRNAME1&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME2 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME3 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRNAME4 || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRORT&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRPLZ&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 10 || - || Lieferadresse&lt;br /&gt;
|-&lt;br /&gt;
| ZIELADRREGION || [[#Datentypen|String]] || 20 || - || Staat/Provinz (z.B.: für Sendungen in die USA wichtig)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;ZIELADRSTRASSE&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 50 || - || Lieferadresse&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung|&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 wenn Erfolgreich&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || Wird im Fehlerfall befüllt&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || Wird im Fehlerfall befüllt&lt;br /&gt;
|-&lt;br /&gt;
| GEBUEHR || [[#Datentypen|Decimal]] || 18 || 2 || Frachtkosten&lt;br /&gt;
|-&lt;br /&gt;
| GEBUEHRWAEHRUNG || [[#Datentypen|String]] || 3 || - || Frachkosten ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || PackstueckID aus der Anfrage&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstückdaten aktualisieren (UpdateVersandDaten) =&lt;br /&gt;
Die Gatewayfunktion UpdateVersandDaten wird vom Data-Gateway-Server im Automatik-Polling Modus an das HVS32 gesendet, um dort die Daten von bestehende Packstücken zu verändern.&lt;br /&gt;
Diese Anfrage wird zum Beispiel gesendet, wenn der Warenwert für ein Packstück erst zu einem späteren Zeitpunkt bekannt ist.&lt;br /&gt;
Aktualisiert werden können Daten innerhalb der Tabellen Versandeinheit, Abrechnungseinheit und Lieferung. Dabei wird stets über das Feld PackstueckID und bei Belegung auch über das Feld TrackingNr gesucht.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Bei dieser Anfrage werden allerdings die zu aktualisierenden Felder und Inhalte nicht mehr nach den Richtlinien des Frachtführers geprüft (z.B. Gewichtsgrenzen, etc.). Es muss somit vom Vorsystem sichergestellt werden, dass die aktualisierenden Werte mit den Richtlinien des Frachtführers übereinstimmen. Sollte dies nicht möglich sein, kann diese Funktion nicht genutzt werden, sondern das Etikett muss storniert und neu verarbeitet werden. Außerdem können Felder, welche bereits auf einem Etikett angedruckt oder vom Versandsystem HVS32 in einer Frachtführerabwicklung ermittelt wurden (z.B. Adresse, Route, TrackingNr, Sonderdienste, etc.) nicht manipuliert werden.&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;ACHTUNG: Alle Felder, welche im Versandsystem aktualisiert werden sollen, müssen vor der Nutzung dieser Funktion abgestimmt und im Versandsystem entsprechend konfiguriert werden!&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Es stehen keine Packstück-/Sendungs-Daten für die Rückmeldung zur Verfügung. Nach erfolgreichem Update wird lediglich das Feld Fehler mit Wert 0 zurückgemeldet - bzw. im Fehlerfall wird Fehler mit dem Wert 1 sowie der Fehlertext1 zurückgemeldet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;PACKSTUECKID&amp;#039;&amp;#039;&amp;#039; || [[#Datentypen|String]] || 20 || - || Eindeutige Nummer für das Paket im Vorsystem. Wird als eindeutige Paketreferenz benötigt um den Datensatz zu identifizieren.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der den Auftrag verarbeiten soll.&lt;br /&gt;
|-&lt;br /&gt;
| ANSPRECHPARTNER || [[#Datentypen|String]] || 50 || - || Empfänger Ansprechpartner&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS1 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISHINWEIS2 || [[#Datentypen|String]] || 100 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ1 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 1&lt;br /&gt;
|-&lt;br /&gt;
| AVISZUSATZ2 || [[#Datentypen|String]] || 60 || - || Zusatz zu Fest-AVIS-Schlüssel 2&lt;br /&gt;
|-&lt;br /&gt;
| BESTELLNR || [[#Datentypen|String]] || 20 || - || Metro-Bestellnr (Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| EMAIL || [[#Datentypen|String]] || 100 || - || E-Mail Adresse des Empfängers (z.B.: für die Automatische E-Mail Avisierung)&lt;br /&gt;
|-&lt;br /&gt;
| EMPFMOBILFUNKNR || [[#Datentypen|String]] || 20 || - || Mobilfunknummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FAXNR || [[#Datentypen|String]] || 20 || - || Faxnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| FLEXZUSTELLUNGEMAILADRESSE || [[#Datentypen|String]] || 80 || - || Flex-Zustellung Emailadresse&lt;br /&gt;
|-&lt;br /&gt;
| GEWICHT || [[#Datentypen|Decimal]] || 8 || 3 || Bruttogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| NETTOGEWICHT || [[#Datentypen|Decimal]] || 8 || 3 || Nettogewicht in KG&lt;br /&gt;
|-&lt;br /&gt;
| ILNNR || [[#Datentypen|String]] || 20 || - || ILN des Empfängers (Pflicht bei Metro-Versand)&lt;br /&gt;
|-&lt;br /&gt;
| KOSTENSTELLE || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| LIEFERANTENID || [[#Datentypen|Integer]] || - || - || -&lt;br /&gt;
|-&lt;br /&gt;
| NACHNAHME || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| NNVERMERK || [[#Datentypen|String]] || 1 || - || B&amp;#039;: Bar / &amp;#039;V&amp;#039;: Verrechnungsscheck&lt;br /&gt;
|-&lt;br /&gt;
| NNVERWENDUNG || [[#Datentypen|String]] || 30 || - || Nachnahme Verwendungszweck&lt;br /&gt;
|-&lt;br /&gt;
| NNWAEHRUNG || [[#Datentypen|String]] || 3 || - || Nachnahme - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKBREITE || [[#Datentypen|Integer]] || - || - || Breite in cm&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKHOEHE || [[#Datentypen|Integer]] || - || - || Höhe in cm&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKLAENGE || [[#Datentypen|Integer]] || - || - || Länge in cm&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFLKZ || [[#Datentypen|String]] || 5 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME1 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME2 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFNAME3 || [[#Datentypen|String]] || 50 || - || Rechnungsempfänger&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFORT || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFPLZ || [[#Datentypen|String]] || 10 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSEMPFSTRASSE || [[#Datentypen|String]] || 50 || - || Rechnungsadresse&lt;br /&gt;
|-&lt;br /&gt;
| RECHNUNGSNR || [[#Datentypen|String]] || 20 || - || Rechnungsnummer&lt;br /&gt;
|-&lt;br /&gt;
| SENDUNGSINHALT || [[#Datentypen|String]] || 30 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| TELEFONNR || [[#Datentypen|String]] || 20 || - || Telefonnummer des Empfängers&lt;br /&gt;
|-&lt;br /&gt;
| VORPACKDATUM || [[#Datentypen|String]] || 10 || - || TT.MM.JJJJ&lt;br /&gt;
|-&lt;br /&gt;
| VERSICHERUNGSWERT || [[#Datentypen|Decimal]] || 18 || 2 || Höhe Versicherungswert&lt;br /&gt;
|-&lt;br /&gt;
| VWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Versicherungswert - ISO-Währungscode&lt;br /&gt;
|-&lt;br /&gt;
| WECHSELBRUECKE || [[#Datentypen|String]] || 20 || - || Wechselbrücke, die diesem Packstück zugewiesen wird&lt;br /&gt;
|-&lt;br /&gt;
| WARENWERT || [[#Datentypen|Decimal]] || 18 || 2 || -&lt;br /&gt;
|-&lt;br /&gt;
| WWWAEHRUNG || [[#Datentypen|String]] || 3 || - || Warenwert - ISO-Währungscode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Packstückdaten anonymisieren (AnonymisiereVersandDaten) =&lt;br /&gt;
Das Gateway sendet die AnonymisiereVersandDaten an das Automatik-Polling des HVS32. Im HVS32 werden somit Kunden bezogene Daten für den entsprechenden Datensatz gemäß DSGVO anonymisiert.&lt;br /&gt;
Diese Anonymisierung wird unwiderruflich und endgültig auf der Datenbankebene des Versandsystems durchgeführt. Eine Wiederherstellung der ursprünglichen Daten ist somit nicht mehr möglich.&lt;br /&gt;
Log-Dateien, Rückmelde-Dateien, bereits übertragene Frachtführer DFÜs etc. sind hiervon nicht betroffen. Es können ausschließlich Packstücke und Sendungen anonymisiert werden, welche bereits Tages abgeschlossen sind.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || PackstückID des Packstücks, welches anonymisiert werden soll.&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || TrackingNr des Packstücks, welches anonymisiert werden soll.&lt;br /&gt;
|-&lt;br /&gt;
| LIEFERSCHEINNR || [[#Datentypen|String]] || 40 || - || LieferscheinNr der Sendung, welche anonymisiert werden soll.&lt;br /&gt;
|-&lt;br /&gt;
| AUFTRAGSNR || [[#Datentypen|String]] || 50 || - || AuftragsNr der Sendung, welche anonymisiert werden soll.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, der die Anonymisierung verarbeiten soll.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Statusdaten für ein Packstück abrufen (StatusDatenAnfrage) =&lt;br /&gt;
Das Gateway sendet die StatusDatenAnfrage an das Automatik-Polling des HVS32. Im HVS32 werden zu diesem Packstück alle vorhandenen Statusdaten abgerufen und ans Gateway zurückgemeldet.&amp;lt;br&amp;gt;&lt;br /&gt;
Das Packstück wird anhand der PackstueckId, der TrackingNr oder einer kombination aus beiden (falls nur einer der beiden Referenzen nicht eundeutig ist) identifiziert.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Werden im HVS32 zu der Referenz mehrere Packstücke identifiziert, so wird immer das aktuellste Packstück verwendet.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Übergabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;#039;&amp;#039;&amp;#039;Fett&amp;#039;&amp;#039;&amp;#039; dargestellte Felder müssen IMMER belegt sein&amp;lt;/small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || Eindeutige Packstueck-Id aus dem Hostsystem, welches das Packstück identifiziert.&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || TrackingNr des Packstuecks.&lt;br /&gt;
|-&lt;br /&gt;
| PACKPLATZ || [[#Datentypen|String]] || 10 || - || HVS32-Packplatz-Client, welcher die Anfrage verarbeiten soll (Optional).&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Rückgabe Parameter&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feldname !! Typ !! Max Länge !! Dezimalstellen !! Belegung&lt;br /&gt;
|-&lt;br /&gt;
| FEHLER || [[#Datentypen|Integer]] || - || - || 0 = Erfolgreich, 1 = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT1 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERTEXT2 || [[#Datentypen|String]] || 200 || - || -&lt;br /&gt;
|-&lt;br /&gt;
| EINTRAGDATETIME || [[#Datentypen|String]] || 25 || - || Datum und optional Uhrzeit, wann der Statuscode ins HVS32 importiert worden ist (Format abhängig vom Betriebssystem)&lt;br /&gt;
|-&lt;br /&gt;
| EINTRAGDATETIME_TIMESTAMP || [[#Datentypen|String]] || 25 || - || Datum und optional Uhrzeit, wann der Statuscode ins HVS32 importiert worden ist (Format: dd.mm.yyyy hh:mm:ss)&lt;br /&gt;
|-&lt;br /&gt;
| EMPFANGSQUITTIERER || [[#Datentypen|String]] || 100 || - || Name des Empfängers, der das Paket/die Sendung entgegen nahm&lt;br /&gt;
|-&lt;br /&gt;
| FEHLERSTATUS || [[#Datentypen|String]] || 2 || - || I = Info, F = Fehler&lt;br /&gt;
|-&lt;br /&gt;
| FFSTATUSCODE || [[#Datentypen|String]] || 10 || - || Frachtführerspezifischer Statuscode&lt;br /&gt;
|-&lt;br /&gt;
| FFSTATUSKLARTEXT || [[#Datentypen|String]] || 250 || - || Klartext der den Statuscode beschreibt&lt;br /&gt;
|-&lt;br /&gt;
| FFZUSATZCODE || [[#Datentypen|String]] || 10 || - || Zusätzlicher Statuscode&lt;br /&gt;
|-&lt;br /&gt;
| FFZUSATZKLARTEXT || [[#Datentypen|String]] || 120 || - || Klartext der den zusätzlichen Statuscode beschreibt&lt;br /&gt;
|-&lt;br /&gt;
| PACKSTUECKID || [[#Datentypen|String]] || 20 || - || Eindeutige Packstueck-Id aus dem Hostsystem, welches das Packstück identifiziert.&lt;br /&gt;
|-&lt;br /&gt;
| STATUSDATETIME || [[#Datentypen|String]] || 25 || - || Datum und optional Uhrzeit des Statuscodes (Format abhängig vom Betriebssystem)&lt;br /&gt;
|-&lt;br /&gt;
| STATUSDATETIME_TIMESTAMP || [[#Datentypen|String]] || 25 || - || Datum und optional Uhrzeit des Statuscodes (Format: dd.mm.yyyy hh:mm:ss)&lt;br /&gt;
|-&lt;br /&gt;
| STATUSORT || [[#Datentypen|String]] || 30 || - || Ort an dem der Status eingetreten ist (z.B. Nummer des Depots)&lt;br /&gt;
|-&lt;br /&gt;
| STATUSTYP || [[#Datentypen|String]] || 30 || - || E = Endestatus, Z = Zwischenstatus&lt;br /&gt;
|-&lt;br /&gt;
| TRACKINGNR || [[#Datentypen|String]] || 35 || - || Trackingnummer&lt;br /&gt;
|-&lt;br /&gt;
| ZUSATZKLARTEXT || [[#Datentypen|String]] || 80 || - || Zusätzliche Informationen&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6219</id>
		<title>HVS32 SAP RFC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6219"/>
		<updated>2025-12-05T13:59:04Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_SAP_RFC_Interface_(Polling)]]&lt;br /&gt;
&lt;br /&gt;
= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.8.40 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP RFC Server&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Es können beliebige RFC Funktionen im DGS implementiert werden, welche von einem RFC-Client (SAP) aus aufgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Je HVS32 Funktion muss ein separater RFC Baustein genutzt werden. Die Struktur des RFC-Bausteins (Felder, Tabellen, Strukturen) ohne Implementierung muss im SAP System auf einem Applikationsserver für den DGS verfügbar sein - da die Metadaten der RFC Bausteine bei Systemstart abgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS registriert sich selbst unter einer Programm-ID an einem SAP Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
RFCServerCentralSAPGateway.png|DGS SAP/RFC Server an zentralem SAP Gateway&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in &amp;#039;&amp;#039;&amp;#039;64Bit&amp;#039;&amp;#039;&amp;#039; (sapjco3.jar + sapjco3.dll)&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ &amp;#039;&amp;#039;&amp;#039;64bit&amp;#039;&amp;#039;&amp;#039; voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
** alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
** Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* SAP RFC User mit entsprechender Berechtigung&lt;br /&gt;
** Bzgl. der Berechtigung kann man mit dem &amp;#039;&amp;#039;SAP note 460089 - Minimum authorization profiles for external RFC programs&amp;#039;&amp;#039; anfangen&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Servername / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| rfcfunctions || Liste aller RFC-Funktionsbausteinen, welche im SAP bereitgestellt werden&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im RFC Baustein als Table oder Struct definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Alle Parameter, welche an das HVS32 gesendet werden sollen, müssen in die Import-Parameter geschrieben werden. Die Rückmeldung aus dem HVS32 erfolgt in den Export-Parametern. Die Kommunikation ist bidirektional, d.h. die Rückmeldung erfolgt synchron in der gleichen Transaktion wie die Anfrage.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die VersandDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSVERSANDDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    KUNDENNR CHAR(20)&lt;br /&gt;
    ZIELADRNAME1 CHAR(50)&lt;br /&gt;
    ZIELADRNAME2 CHAR(50)&lt;br /&gt;
    ZIELADRNAME3 CHAR(50)&lt;br /&gt;
    ZIELADRSTRASSE CHAR(50)&lt;br /&gt;
    ZIELADRLKZ CHAR(5)&lt;br /&gt;
    ZIELADRPLZ CHAR(10)&lt;br /&gt;
    ZIELADRORT CHAR(50)&lt;br /&gt;
    ZIELADRREGION CHAR(20)&lt;br /&gt;
    ZIELADRBAHNHOF CHAR(30)&lt;br /&gt;
    ANSPRECHPARTNER CHAR(20)&lt;br /&gt;
    TELEFONNR CHAR(20)&lt;br /&gt;
    FAXNR CHAR(20)&lt;br /&gt;
    USTIDNR CHAR(20)&lt;br /&gt;
    ILNNR CHAR(20)&lt;br /&gt;
    AUFTRAGGEBERID CHAR(10)&lt;br /&gt;
    VERSANDARTID CHAR(10)&lt;br /&gt;
    AVISHINWEIS1 CHAR(30)&lt;br /&gt;
    AVISHINWEIS2 CHAR(30)&lt;br /&gt;
    AVISZUSATZ1 CHAR(20)&lt;br /&gt;
    AVISZUSATZ2 CHAR(20)&lt;br /&gt;
    LIEFERSCHEINNR CHAR(40)&lt;br /&gt;
    AUFTRAGNR CHAR(20)&lt;br /&gt;
    BESTELLNR CHAR(20)&lt;br /&gt;
    WARENWERT CHAR(19)&lt;br /&gt;
    WWWAEHRUNG CHAR(3)&lt;br /&gt;
    NACHNAHME CHAR(19)&lt;br /&gt;
    NNWAEHRUNG CHAR(3)&lt;br /&gt;
    NNVERMERK CHAR(1)&lt;br /&gt;
    NNVERWENDUNG CHAR(30)&lt;br /&gt;
    VERSICHERUNGSWERT CHAR(19)&lt;br /&gt;
    VWWAEHRUNG CHAR(3)&lt;br /&gt;
    FRANKATURKENNUNG CHAR(10)&lt;br /&gt;
    ZAHLUNGSBEDIGNUNG CHAR(10)&lt;br /&gt;
    ZBZOLL CHAR(1)&lt;br /&gt;
    FRACHTFUEHRERKDNR CHAR(10)&lt;br /&gt;
    SONDERDIENSTE CHAR(30)&lt;br /&gt;
    SENDUNGSINHALT CHAR(30)&lt;br /&gt;
    TERMINART CHAR(1)&lt;br /&gt;
    TERMINDATUM CHAR(10)&lt;br /&gt;
    TERMINZEIT CHAR(5)&lt;br /&gt;
    NEUTABSENDERNAME1 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME2 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME3 CHAR(30)&lt;br /&gt;
    NEUTABSENDERSTRASSE CHAR(30)&lt;br /&gt;
    NEUTABSENDERLKZ CHAR(3)&lt;br /&gt;
    NEUTABSENDERPLZ CHAR(10)&lt;br /&gt;
    NEUTABSENDERORT CHAR(30)&lt;br /&gt;
    RECHNUNGSEMPFNAME1 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME2 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME3 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFSTRASSE CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFLKZ CHAR(5)&lt;br /&gt;
    RECHNUNGSEMPFPLZ CHAR(10)&lt;br /&gt;
    RECHNUNGSEMPFORT CHAR(50)&lt;br /&gt;
    POSTLEITCODE CHAR(15)&lt;br /&gt;
    POSTZIELFRACHTZENT CHAR(5)&lt;br /&gt;
    FRACHTBRIEF CHAR(20)&lt;br /&gt;
    GEWICHT CHAR(9)&lt;br /&gt;
    NETTOGEWICHT CHAR(9)&lt;br /&gt;
    PACKSTKGES CHAR(10)&lt;br /&gt;
    PACKSTKNR CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(6)&lt;br /&gt;
    PACKSTUECKLAENGE CHAR(10)&lt;br /&gt;
    PACKSTUECKBREITE CHAR(10)&lt;br /&gt;
    PACKSTUECKHOEHE CHAR(10)&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(15)&lt;br /&gt;
    ANZAHLARTIKEL CHAR(10)&lt;br /&gt;
    ZUSATZZEILE1 CHAR(150)&lt;br /&gt;
    ZUSATZZEILE2 CHAR(150)&lt;br /&gt;
    FREIAVIS1 CHAR(62)&lt;br /&gt;
    FREIAVIS2 CHAR(62)&lt;br /&gt;
    HVELEKTRONIKARTIKEL CHAR(1)&lt;br /&gt;
    EMPFEMAILADRESSE CHAR(100)&lt;br /&gt;
    KOSTENSTELLE CHAR(30)&lt;br /&gt;
    DRUCKERNAME CHAR(30)&lt;br /&gt;
  DGPOSITIONS STRUCTURE&lt;br /&gt;
    GEFAHRGUTUNNR CHAR(4)&lt;br /&gt;
    GEFAHRGUTKLASSE CHAR(6)&lt;br /&gt;
    GEFAHRGUTVPG CHAR(5)&lt;br /&gt;
    GEFAHRGUTKCODE CHAR(5)&lt;br /&gt;
    GEFAHRGUTBEZEICHNUNG CHAR(110)&lt;br /&gt;
    GEFAHRGUTMENGE CHAR(9)&lt;br /&gt;
    GEFAHRGUTBEGRENZTEMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTVERPANZAHL CHAR(10)&lt;br /&gt;
    GEFAHRGUTVERPACKUNGSART CHAR(8)&lt;br /&gt;
    GEFAHRGUTNEBENGEFAHR CHAR(20)&lt;br /&gt;
    GEFAHRGUTBUCHST640 CHAR(1)&lt;br /&gt;
    GEFAHRGUTMENGENEINHEIT CHAR(2)&lt;br /&gt;
    GEFAHRGUTBEFOERDKAT CHAR(10)&lt;br /&gt;
    GEFAHRGUTFAKTOR CHAR(10)&lt;br /&gt;
    GEFAHRGUTNETTOEXPLMASSE CHAR(9)&lt;br /&gt;
    GEFAHRGUTTUNNELBCODE CHAR(10)&lt;br /&gt;
    GEFAHRGUTFREIGESTMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTFFCODE CHAR(20)&lt;br /&gt;
  DELIVERYPOSITIONS STRUCTURE&lt;br /&gt;
    ANZAHLPOSETIKETTEN CHAR()&lt;br /&gt;
    ARTIKELBTNNR CHAR(25)&lt;br /&gt;
    ARTIKELEAN CHAR(20)&lt;br /&gt;
    ARTIKELEINHEIT CHAR(10)&lt;br /&gt;
    ARTIKELGEWICHT CHAR(9)&lt;br /&gt;
    ARTIKELMENGE CHAR(9)&lt;br /&gt;
    ARTIKELSOLLMENGE CHAR(9)&lt;br /&gt;
    ARTIKELTEXT1 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT2 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT3 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT4 CHAR(100)&lt;br /&gt;
    ARTIKELWAEHRUNG CHAR(3)&lt;br /&gt;
    ARTIKELWERT CHAR(9)&lt;br /&gt;
    CHARGEFLAG CHAR(1)&lt;br /&gt;
    KUNDENARTIKELNR CHAR(50)&lt;br /&gt;
    KUNDENBESTELLNR CHAR(50)&lt;br /&gt;
    POSAUFTRAGNR CHAR(50)&lt;br /&gt;
    POSITIONNR CHAR(40)&lt;br /&gt;
    POSLIEFERNR CHAR(40)&lt;br /&gt;
    SERIENNR CHAR(30)&lt;br /&gt;
    URSPRUNGLAND CHAR(2)&lt;br /&gt;
    ARTIKELGRUPPE CHAR(50)&lt;br /&gt;
    ARTIKELSERVICES CHAR(100)&lt;br /&gt;
    ARTIKELVOLUMEN CHAR(9)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    VERSANDSENDUNGSNR CHAR(20)&lt;br /&gt;
    DRUCKDATETIME CHAR(10)&lt;br /&gt;
    AUSGANGDATETIME CHAR(10)&lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die StatusDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;Z_STATUSDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(30)&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  STATUSDATEN TABLE&lt;br /&gt;
    PACKSTUECKID CHAR(30)&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    EINTRAGDATETIME CHAR(20)&lt;br /&gt;
    EMPFANGSQUITTIERER CHAR(100)&lt;br /&gt;
    FEHLERSTATUS CHAR(2)&lt;br /&gt;
    FFSTATUSCODE CHAR(10)&lt;br /&gt;
    FFSTATUSKLARTEXT CHAR(250)&lt;br /&gt;
    FFZUSATZCODE CHAR(10)&lt;br /&gt;
    FFZUSATZKLARTEXT CHAR(120)&lt;br /&gt;
    STATUSDATETIME CHAR(20)&lt;br /&gt;
    STATUSORT CHAR(30)&lt;br /&gt;
    STATUSTYP CHAR(2)&lt;br /&gt;
    ZUSATZKLARTEXT CHAR(80)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6130</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6130"/>
		<updated>2025-05-26T14:35:41Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
Please make sure that the certificate chain in the provided certificate is complete.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To request the initial tokens we offer multiple options.&lt;br /&gt;
&lt;br /&gt;
You can either request the tokens via Authorization Basic, in which the ClientID + ClientSecret are exposed in the HTTP header.&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another option is to request the tokens via JWT. In this option the ClientID is within the payload and the JWT is signed with the ClientSecret. This option offers additional securities, since the ClientSecret itself is never exposed.&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div&amp;gt;&amp;#039;&amp;#039;&amp;#039;Example of token request (generating access and refresh tokens with JWT)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request via JWT (jwt-bearer) the ClientID is within the payload as &amp;#039;&amp;#039;sub&amp;#039;&amp;#039; and signed with ClientSecret. The JWT must be transmitted in the HTTP header &amp;#039;&amp;#039;client_assertion&amp;#039;&amp;#039;. To use JWT authentification the HTTP header &amp;#039;&amp;#039;client_assertion_type&amp;#039;&amp;#039; with value &amp;#039;&amp;#039;jwt-bearer&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&lt;br /&gt;
In this example following &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; - &amp;#039;&amp;#039;huF3sPp5g5zUXP70bQ3O&amp;#039;&amp;#039; - was used.&lt;br /&gt;
&lt;br /&gt;
Following &amp;#039;&amp;#039;&amp;#039;ClientSecret&amp;#039;&amp;#039;&amp;#039; was used - &amp;#039;&amp;#039;yX2[K2DC*CjvUI3Us!eCrM@B%5OHJ@U5JCw+)Jv1b+3@1f[?YOw]mxmc(Aes)K5N&amp;#039;&amp;#039;&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
client_assertion_type: jwt-bearer&lt;br /&gt;
client_assertion: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJodUYzc1BwNWc1elVYUDcwYlEzTyIsIm5hbWUiOiJIZWlkbGVyIFN0cmljaGNvZGUgR21iSCBURVNUIiwiaWF0IjoxODE2MjM5MDIyfQ.xKwD4wnQud55LVqvs47Sy0jKhpbxb0JVZtgMWWbjNKo&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Managing Client Credentials in the DGS==&lt;br /&gt;
The client credentials are managed in the DataGatewayServer. You can create new credentials or delete existing ones.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this, start the Credentials Configurator (.exe) located in the installation directory of the DataGatewayServer.&lt;br /&gt;
===Config===&lt;br /&gt;
[[File:Authorization Credentials 001.png|thumb|right|Credentials Configurator - config]]&lt;br /&gt;
On this screen, general configurations can be made.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;If this option is active, the number of invalid authentication attempts will be counted. After &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; within &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039;, all credentials will be locked.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;If this option is active when using OAuth2.0 CC, a &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; will be triggered if a REFRESH TOKEN is reused multiple times. This action deactivates all ACCESS and REFRESH TOKENS, requiring new tokens to be requested via client credentials. Additionally, the DGS Configurator can be configured to send an email notification in the event of a CODE RED.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock Credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;With this button, all credentials can be locked or unlocked. For instance, if all client credentials were locked due to the &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; option, they can be unlocked here. This action takes effect immediately without needing to save.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;This button persistently saves the settings and credentials. The options and credentials only become active after saving. A DGS restart is not required.&lt;br /&gt;
===Managing Credentials===&lt;br /&gt;
[[File:Authorization Credentials 002.png|thumb|right|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[File:Authorization Credentials 003.png|thumb|right|Enter Username / ClientID]]&lt;br /&gt;
[[File:Authorization Credentials 004.png|thumb|right|Show Credentials Dialog]]&lt;br /&gt;
To manage your credentials, select the appropriate tab for the authentication method configured in the DGS (e.g., OAuth2.0 CC).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;create new credentials. Note that the password or client secret will only be displayed once in a dialog. Be sure to copy it to a secure location and ensure no unauthorized persons have access to it.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;assign a new password or client secret. As with the add function, the password or client secret will only be displayed once in a dialog.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;remove the selected credentials.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6129</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6129"/>
		<updated>2025-05-26T14:35:19Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
Please make sure that the certificate chain in the provided certificate is complete.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To request the initial tokens we offer multiple options.&lt;br /&gt;
&lt;br /&gt;
You can either request the tokens via Authorization Basic, in which the ClientID + ClientSecret are exposed in the HTTP header.&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another option is to request the tokens via JWT. In this option the ClientID is within the payload and the JWT is signed with the ClientSecret. This option offers additional securities, since the ClientSecret itself is never exposed.&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div&amp;gt;&amp;#039;&amp;#039;&amp;#039;Example of token request (generating access and refresh tokens with JWT)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request via JWT (jwt-bearer) the ClientID is within the payload as &amp;#039;&amp;#039;sub&amp;#039;&amp;#039; and signed with ClientSecret. The JWT must be transmitted in the HTTP header &amp;#039;&amp;#039;client_assertion&amp;#039;&amp;#039;. To use JWT authentification the HTTP header &amp;#039;&amp;#039;client_assertion_type&amp;#039;&amp;#039; with value &amp;#039;&amp;#039;jwt-bearer&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&lt;br /&gt;
In this example following &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; - &amp;#039;&amp;#039;huF3sPp5g5zUXP70bQ3O&amp;#039;&amp;#039; - was used.&lt;br /&gt;
&lt;br /&gt;
Following &amp;#039;&amp;#039;&amp;#039;ClientSecret&amp;#039;&amp;#039;&amp;#039; was used - &amp;#039;&amp;#039;yX2[K2DC*CjvUI3Us!eCrM@B%5OHJ@U5JCw+)Jv1b+3@1f[?YOw]mxmc(Aes)K5N&amp;#039;&amp;#039;&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
client_assertion_type: jwt-bearer&lt;br /&gt;
client_assertion: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJodUYzc1BwNWc1elVYUDcwYlEzTyIsIm5hbWUiOiJIZWlkbGVyIFN0cmljaGNvZGUgR21iSCBURVNUIiwiaWF0IjoxODE2MjM5MDIyfQ.xKwD4wnQud55LVqvs47Sy0jKhpbxb0JVZtgMWWbjNKo&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Managing Client Credentials in the DGS==&lt;br /&gt;
The client credentials are managed in the DataGatewayServer. You can create new credentials or delete existing ones.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this, start the Credentials Configurator (.exe) located in the installation directory of the DataGatewayServer.&lt;br /&gt;
===Config===&lt;br /&gt;
[[File:Authorization Credentials 001.png|thumb|right|Credentials Configurator - config]]&lt;br /&gt;
On this screen, general configurations can be made.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;If this option is active, the number of invalid authentication attempts will be counted. After &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; within &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039;, all credentials will be locked.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;If this option is active when using OAuth2.0 CC, a &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; will be triggered if a REFRESH TOKEN is reused multiple times. This action deactivates all ACCESS and REFRESH TOKENS, requiring new tokens to be requested via client credentials. Additionally, the DGS Configurator can be configured to send an email notification in the event of a CODE RED.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock Credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;With this button, all credentials can be locked or unlocked. For instance, if all client credentials were locked due to the &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; option, they can be unlocked here. This action takes effect immediately without needing to save.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;This button persistently saves the settings and credentials. The options and credentials only become active after saving. A DGS restart is not required.&lt;br /&gt;
===Managing Credentials===&lt;br /&gt;
[[File:Authorization Credentials 002.png|thumb|right|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[File:Authorization Credentials 003.png|thumb|right|Enter Username / ClientID]]&lt;br /&gt;
[[File:Authorization Credentials 004.png|thumb|right|Show Credentials Dialog]]&lt;br /&gt;
To manage your credentials, select the appropriate tab for the authentication method configured in the DGS (e.g., OAuth2.0 CC).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;create new credentials. Note that the password or client secret will only be displayed once in a dialog. Be sure to copy it to a secure location and ensure no unauthorized persons have access to it.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;assign a new password or client secret. As with the add function, the password or client secret will only be displayed once in a dialog.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;remove the selected credentials.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6128</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6128"/>
		<updated>2025-05-26T14:35:04Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Interfaces:_Security_Levels_and_Authentication]]&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&lt;br /&gt;
&lt;br /&gt;
Für die Verschlüsselung wird jeweils ein Zertifikat mit zugehörigem Private Key benötigt. Die folgenden Zertifikatsformate werden unterstützt:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zertifikate:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der oder *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, oder *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
Stellen Sie sicher, dass falls vorhanden die Zertifikatskette vollständig im Zertifikat hinterlegt ist.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&amp;lt;br&amp;gt;Es wird &amp;#039;&amp;#039;&amp;#039;mindestens&amp;#039;&amp;#039;&amp;#039; die DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Bei der initialen Tokenanfrage stehen verschiedene zwei Möglichkeiten zum Abrufen bereit.&lt;br /&gt;
&lt;br /&gt;
Zum einen kann man die Token über die Authorization Basic anfragen, bei welchem die ClientID + ClientSecret im HTTP-Header mitgegeben werden.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;Eine weitere Variante die Token abzurufen ist über einen JWT. Bei dieser Methode wird die ClientID im Payload vom JWT übermittelt und das JWT selbst mit dem ClientSecret signiert. Diese Möglichkeit bietet eine zusätzliche Sicherheit, da dass ClientSecret selbst nie exposed wird.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken über JWT generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage &amp;#039;&amp;#039;&amp;#039;JWT (jwt-bearer)&amp;#039;&amp;#039;&amp;#039; muss die Client-ID und das Client-Secret in einem JWT übermittelt werden. Dabei wird die &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; im JWT Payload als &amp;quot;sub&amp;quot; übermittelt und mit dem ClientSecret signiert. Das JWT wird Im HTTP-Header als &amp;#039;&amp;#039;client_assertion&amp;#039;&amp;#039; übermittelt. Die Anfrage über das JWT erfolgt über den HTTP-Header &amp;#039;&amp;#039;client_assertion_type&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&lt;br /&gt;
In diesem Beispiel wurde die &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; - &amp;#039;&amp;#039;huF3sPp5g5zUXP70bQ3O&amp;#039;&amp;#039; - verwendet.&lt;br /&gt;
&lt;br /&gt;
Das &amp;#039;&amp;#039;&amp;#039;ClientSecret&amp;#039;&amp;#039;&amp;#039; lautet - &amp;#039;&amp;#039;yX2[K2DC*CjvUI3Us!eCrM@B%5OHJ@U5JCw+)Jv1b+3@1f[?YOw]mxmc(Aes)K5N&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
client_assertion_type: jwt-bearer&lt;br /&gt;
client_assertion: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJodUYzc1BwNWc1elVYUDcwYlEzTyIsIm5hbWUiOiJIZWlkbGVyIFN0cmljaGNvZGUgR21iSCBURVNUIiwiaWF0IjoxODE2MjM5MDIyfQ.xKwD4wnQud55LVqvs47Sy0jKhpbxb0JVZtgMWWbjNKo&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Client Credentials im DGS verwalten==&lt;br /&gt;
Die Client Credentials werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&amp;lt;br&amp;gt;&lt;br /&gt;
Dazu muss im Installationsverzeichnis des DataGatewayServer der Credentials-Configurator(.exe) gestartet werden.&lt;br /&gt;
===Config===&lt;br /&gt;
[[Datei:Authorization Credentials 001.png|mini|rechts|Credentials Configurator - config]]&lt;br /&gt;
Hier können allgemeine Konfigurationen vorgenommen werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option aktiv ist, wird die Anzahl der ungültigen Authentifizierungen gezählt und nach &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; innerhalb von &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039; werden alle Credentials gesperrt&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option bei der Nutzung von OAuth2.0 CC aktiv ist, wird bei mehrfachen verwenden eines REFRESH TOKENS ein &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; ausgelöst. Hierbei werden alle ACCESS und REFRESH TOKENS deaktiviert und es müssen neue Tokens via Client Credentials angefordert werden. Zusätzlich kann im DGS Konfigurator das Versenden einer E-Mail bei einem CODE RED konfiguriert werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Über diesen Button können alle Credentials gesperrt oder entsperrt werden. Wenn z.b. durch die Option &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; alle Client Credentials gesperrt wurden, können diese somit wieder entsperrt werden. Diese Option greift sofort, ohne speichern.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;Mit diesem Button werden die Einstellungen und Credentials persistent gespeichert. Erst nach dem Speichern werden die Optionen und Credentials aktiv. Ein DGS Neustart ist nicht notwendig.&lt;br /&gt;
===Credentials verwalten===&lt;br /&gt;
[[Datei:Authorization Credentials 002.png|mini|rechts|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[Datei:Authorization Credentials 003.png|mini|rechts|Enter Username / ClientID]]&lt;br /&gt;
[[Datei:Authorization Credentials 004.png|mini|rechts|Show Credentials Dialog]]&lt;br /&gt;
Um Ihre Credentials zu verwalten, wählen Sie den passenden Reiter zu Ihrer im DGS konfigurierten Authentifizierungs-Methode (z.B. OAuth2.0 CC)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie neue Credentials anlegen. Beachten Sie, dass das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt wird. Kopieren Sie es daher in einen sicheren Platz und stellen Sie sicher, dass keine unautorisierten Personen darauf Zugriff haben.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; bzw. &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie ein neues Passwort bzw. Client Secret vergeben. Wie bei der add Funktion, wird das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie die die ausgewählten Credentials entfernen.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Interaktiv)&amp;diff=6127</id>
		<title>HVS32 SAP RFC Schnittstelle (Interaktiv)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Interaktiv)&amp;diff=6127"/>
		<updated>2025-05-20T07:57:33Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_SAP_RFC_Interface_(Interactive)]]&lt;br /&gt;
&lt;br /&gt;
= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.6.0.550 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Server, SAP RFC Client&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Verbindung über das RFC-Protokoll mit einem ABAP Applikations-Server die SAP Bibliothek &amp;quot;JCo&amp;quot;. Bei interaktiver Verarbeitung werden Anfragen aus dem Versandsystem heraus an das SAP-System gestellt. Dabei agiert der DGS als RFC Client-Programm, welches sich explizit an einen bestimmten SAP-Applikationsserver zur Bearbeitung der Anfrage wendet.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
RFCClientSapServer.png|Architektur: DGS SAP/RFC Client&lt;br /&gt;
RFCClientSapServerGroup.png|Architektur: DGS SAP/RFC Client (Server Gruop)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in &amp;#039;&amp;#039;&amp;#039;64Bit&amp;#039;&amp;#039;&amp;#039; (sapjco3.jar + sapjco3.dll)&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ &amp;#039;&amp;#039;&amp;#039;64bit&amp;#039;&amp;#039;&amp;#039; voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
** alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
** Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* SAP RFC User mit entsprechender Berechtigung&lt;br /&gt;
** Bzgl. der Berechtigung kann man mit dem &amp;#039;&amp;#039;SAP note 460089 - Minimum authorization profiles for external RFC programs&amp;#039;&amp;#039; anfangen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um RFC Bausteine bei einem SAP System aufzurufen:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| RFCFunctions || Liste aller RFC-Funktionsbausteinen, welche im SAP bereitgestellt werden&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im RFC Baustein als Table oder Struct definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Das HVS32 sendet die Daten in den Import-Parametern - alle Parameter, welche an das HVS32 übertragen werden sollen, müssen in die Export-Parameter geschrieben werden. Die Kommunikation ist bidirektional, d.h. die Rückmeldung von SAP erfolgt synchron in der gleichen Transaktion wie die Anfrage.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Funktionen_Interaktiv|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die VersandDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSVERSANDDATENANFRAGE&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  REFERENCENO CHAR(40)&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    KUNDENNR CHAR(20)&lt;br /&gt;
    ZIELADRNAME1 CHAR(50)&lt;br /&gt;
    ZIELADRNAME2 CHAR(50)&lt;br /&gt;
    ZIELADRNAME3 CHAR(50)&lt;br /&gt;
    ZIELADRSTRASSE CHAR(50)&lt;br /&gt;
    ZIELADRLKZ CHAR(5)&lt;br /&gt;
    ZIELADRPLZ CHAR(10)&lt;br /&gt;
    ZIELADRORT CHAR(50)&lt;br /&gt;
    ZIELADRREGION CHAR(20)&lt;br /&gt;
    ZIELADRBAHNHOF CHAR(30)&lt;br /&gt;
    AUFTRAGGEBERID CHAR(10)&lt;br /&gt;
    VERSANDARTID CHAR(10)&lt;br /&gt;
    LIEFERSCHEINNR CHAR(40)&lt;br /&gt;
    AUFTRAGNR CHAR(20)&lt;br /&gt;
    BESTELLNR CHAR(20)&lt;br /&gt;
    NEUTABSENDERNAME1 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME2 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME3 CHAR(30)&lt;br /&gt;
    NEUTABSENDERSTRASSE CHAR(30)&lt;br /&gt;
    NEUTABSENDERLKZ CHAR(3)&lt;br /&gt;
    NEUTABSENDERPLZ CHAR(10)&lt;br /&gt;
    NEUTABSENDERORT CHAR(30)&lt;br /&gt;
 &lt;br /&gt;
TABLE  DGPOSITIONS&lt;br /&gt;
    UNNR CHAR(4)&lt;br /&gt;
    KLASSE CHAR(6)&lt;br /&gt;
    VPG CHAR(5)&lt;br /&gt;
    KCODE CHAR(5)&lt;br /&gt;
    BEZEICHNUNG CHAR(110)&lt;br /&gt;
    MENGE CHAR(9)&lt;br /&gt;
    BEGRENZTEMENGE CHAR(1)&lt;br /&gt;
    VERPANZAHL CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(8)&lt;br /&gt;
    NEBENGEFAHR CHAR(20)&lt;br /&gt;
    BUCHST640 CHAR(1)&lt;br /&gt;
    MENGENEINHEIT CHAR(2)&lt;br /&gt;
    BEFOERDKAT CHAR(10)&lt;br /&gt;
    FAKTOR CHAR(10)&lt;br /&gt;
    NETTOEXPLMASSE CHAR(9)&lt;br /&gt;
    TUNNELBCODE CHAR(10)&lt;br /&gt;
    FREIGESTMENGE CHAR(1)&lt;br /&gt;
    FFCODE CHAR(20)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die PaketscheinDruckMeldung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSPAKETSCHEINDRUCKMELDUNG&amp;#039;.&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
  LIEFERSCHEINNR CHAR(40)&lt;br /&gt;
  PACKSTKGES CHAR(10)&lt;br /&gt;
  PACKSTKNR CHAR(10)&lt;br /&gt;
  GEWICHT CHAR(9)&lt;br /&gt;
  PACKSTUECKLAENGE CHAR(10)&lt;br /&gt;
  PACKSTUECKBREITE CHAR(10)&lt;br /&gt;
  PACKSTUECKHOEHE CHAR(10)&lt;br /&gt;
  TRACKINGNR CHAR(35)&lt;br /&gt;
  VERSANDSENDUNGSNR CHAR(20)&lt;br /&gt;
  DRUCKDATETIME CHAR(10)&lt;br /&gt;
  AUSGANGDATETIME CHAR(10)&lt;br /&gt;
  GEBUEHR CHAR(19)&lt;br /&gt;
  GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
EXPORTING&lt;br /&gt;
  FEHLERTEXT1 CHAR(200)&lt;br /&gt;
  FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die AusgangslistenRueckMeldung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSAusgangslistenRueckMeldung&amp;#039;.&lt;br /&gt;
IMPORTING&lt;br /&gt;
  AUSGANGSLISTENR (20)&lt;br /&gt;
  PACKSTUECKRUECK TABLE&lt;br /&gt;
    LIEFERSCHEINNR CHAR(40)  &lt;br /&gt;
    TRACKINGNR CHAR(35)  &lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
oder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;ZHVSAusgangslistenRueckMeldung&amp;#039;.&lt;br /&gt;
IMPORTING&lt;br /&gt;
  AUSGANGSLISTENR (20)&lt;br /&gt;
&lt;br /&gt;
TABLE PACKSTUECKRUECK&lt;br /&gt;
  LIEFERSCHEINNR CHAR(40)  &lt;br /&gt;
  TRACKINGNR CHAR(35)  &lt;br /&gt;
  GEBUEHR CHAR(19)&lt;br /&gt;
  GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Interface_(Polling)&amp;diff=6123</id>
		<title>HVS32 SAP RFC Interface (Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Interface_(Polling)&amp;diff=6123"/>
		<updated>2025-04-11T09:03:15Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)]]&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.8.40 or higher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP RFC Server&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Functional description =&lt;br /&gt;
The DataGatewayServer (DGS) uses the SAP library &amp;quot;JCo&amp;quot; for communication with an SAP system and acts as a JCo server program during automatic polling.&lt;br /&gt;
&lt;br /&gt;
The DGS is the central communication unit through which all data is exchanged between the shipping system and the SAP system. It runs in the context of a service on a Windows server.&lt;br /&gt;
&lt;br /&gt;
Any RFC functions can be implemented in the DGS, which are called from an RFC client (SAP). &lt;br /&gt;
&lt;br /&gt;
A separate RFC module must be used for each HVS32 function. The structure of the RFC module (fields, tables, structures) without implementation must be available in the SAP system on an application server for the DGS - since the metadata of the RFC modules are retrieved at system startup. &lt;br /&gt;
&lt;br /&gt;
The DGS registers itself under a program ID at a SAP gateway (not for a specific SAP system) and waits for incoming RFC calls.&lt;br /&gt;
&lt;br /&gt;
If an RFC call is transmitted from any SAP system to this SAP Gateway with the option &amp;quot;Connection with an already registered program&amp;quot; (with the same program ID), the connection with the DGS takes place.&lt;br /&gt;
&lt;br /&gt;
After executing an RFC function, the DGS waits for further RFC calls from the same or another SAP system.&lt;br /&gt;
&lt;br /&gt;
In the event of an interrupted or terminated RFC connection, the DGS automatically re-registers with the same SAP gateway under the same program ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
RFCServerCentralSAPGateway.png|DGS SAP/RFC server at central SAP gateway.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Required SAP components/parameters =&lt;br /&gt;
* latest version 3 of SAP library Java Connector &amp;quot;JCo&amp;quot; in 64Bit.&lt;br /&gt;
* SAP GUI installation on the server where the DataGatewayServer is installed - alternatively a manual adjustment of %SystemRoot%\system32\drivers\etc\services and %SystemRoot%\system32\drivers\etc\hosts.&lt;br /&gt;
* SAP RFC User with enough permissions&lt;br /&gt;
**For permissions you can start with &amp;#039;&amp;#039;SAP note 460089 - Minimum authorization profiles for external RFC programs&amp;#039;&amp;#039;&lt;br /&gt;
* a defined destination with connection type T (TCP/IP connection) in the SAP system via transaction SM59 &lt;br /&gt;
([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
the following parameters are required by the DGS to register with a program ID at a SAP gateway:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP gateway at which the function modules are registered&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP gateway service (port) which is used (e.g. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || program ID from SM59 under which the registration takes place&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Number of simultaneous connections that can be used later by SAP to call the program		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP application server on which the structure of the RFC block is located&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP system no.&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Client ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP user with rights to execute RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Password&lt;br /&gt;
|-&lt;br /&gt;
| rfcfunctions || List of function modules provided by the DataGatewayServer to SAP&lt;br /&gt;
|}&lt;br /&gt;
If load balancing (SAP Message Server) is used on the SAP side for client-side RFC calls, the following must be configured instead of the ashost and sysnr parameters:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Description&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP or name of the SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID of the SAP system&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name of the SAP server group&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Available HVS32 functions =&lt;br /&gt;
Item data and dangerous goods information must be defined as Table or Struct in the RFC module, as they have a 1:n relationship to the package data.&amp;lt;br&amp;gt;&lt;br /&gt;
All parameters which are to be sent to the HVS32 must be written into the import parameters. The feedback from the HVS32 is done in the export parameters. The communication is bidirectional, i.e. the feedback is done synchronously in the same transaction as the request.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the field descriptions refer only to a standard, which should serve as a suggestion for the interface. Function names, field names /-lengths /-formats may differ in principle, but in this case must be considered/analyzed individually.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32 automatic polling functions|Available HVS32 functions]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of RFC module structure for shippingDataRequest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;Z_HVS_VERSANDDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    KUNDEN_NR CHAR(20)&lt;br /&gt;
    ZIEL_ADR_NAME1 CHAR(50)&lt;br /&gt;
    ZIEL_ADR_NAME2 CHAR(50)&lt;br /&gt;
    ZIEL_ADR_NAME3 CHAR(50)&lt;br /&gt;
    ZIEL_ADR_STRASSE CHAR(50)&lt;br /&gt;
    ZIEL_ADR_LKZ CHAR(5)&lt;br /&gt;
    ZIEL_ADR_PLZ CHAR(10)&lt;br /&gt;
    ZIEL_ADR_ORT CHAR(50)&lt;br /&gt;
    ZIEL_ADR_REGION CHAR(20)&lt;br /&gt;
    ZIEL_ADR_BAHNHOF CHAR(30)&lt;br /&gt;
    ANSPRECHPARTNER CHAR(20)&lt;br /&gt;
    TELEFON_NR CHAR(20)&lt;br /&gt;
    FAX_NR CHAR(20)&lt;br /&gt;
    UST_ID_NR CHAR(20)&lt;br /&gt;
    ILN_NR CHAR(20)&lt;br /&gt;
    AUFTRAGGEBER_ID CHAR(10)&lt;br /&gt;
    VERSANDART_ID CHAR(10)&lt;br /&gt;
    AVIS_HINWEIS1 CHAR(30)&lt;br /&gt;
    AVIS_HINWEIS2 CHAR(30)&lt;br /&gt;
    AVIS_ZUSATZ1 CHAR(20)&lt;br /&gt;
    AVIS_ZUSATZ2 CHAR(20)&lt;br /&gt;
    LIEFERSCHEIN_NR CHAR(40)&lt;br /&gt;
    AUFTRAG_NR CHAR(20)&lt;br /&gt;
    BESTELL_NR CHAR(20)&lt;br /&gt;
    WARENWERT CHAR(19)&lt;br /&gt;
    WW_WAEHRUNG CHAR(3)&lt;br /&gt;
    NACHNAHME CHAR(19)&lt;br /&gt;
    NN_WAEHRUNG CHAR(3)&lt;br /&gt;
    NN_VERMERK CHAR(1)&lt;br /&gt;
    NN_VERWENDUNG CHAR(30)&lt;br /&gt;
    VERSICHERUNGSWERT CHAR(19)&lt;br /&gt;
    VW_WAEHRUNG CHAR(3)&lt;br /&gt;
    FRANKATUR_KENNUNG CHAR(10)&lt;br /&gt;
    ZAHLUNGSBEDIGNUNG CHAR(10)&lt;br /&gt;
    ZB_ZOLL CHAR(1)&lt;br /&gt;
    FRACHTFUEHRER_KD_NR CHAR(10)&lt;br /&gt;
    SONDERDIENSTE CHAR(30)&lt;br /&gt;
    SENDUNGS_INHALT CHAR(30)&lt;br /&gt;
    TERMIN_ART CHAR(1)&lt;br /&gt;
    TERMIN_DATUM CHAR(10)&lt;br /&gt;
    TERMIN_ZEIT CHAR(5)&lt;br /&gt;
    NEUTABSENDER_NAME1 CHAR(30)&lt;br /&gt;
    NEUTABSENDER_NAME2 CHAR(30)&lt;br /&gt;
    NEUTABSENDER_NAME3 CHAR(30)&lt;br /&gt;
    NEUTABSENDER_STRASSE CHAR(30)&lt;br /&gt;
    NEUTABSENDER_LKZ CHAR(3)&lt;br /&gt;
    NEUTABSENDER_PLZ CHAR(10)&lt;br /&gt;
    NEUTABSENDER_ORT CHAR(30)&lt;br /&gt;
    RECHNUNGS_EMPF_NAME1 CHAR(50)&lt;br /&gt;
    RECHNUNGS_EMPF_NAME2 CHAR(50)&lt;br /&gt;
    RECHNUNGS_EMPF_NAME3 CHAR(50)&lt;br /&gt;
    RECHNUNGS_EMPF_STRASSE CHAR(50)&lt;br /&gt;
    RECHNUNGS_EMPF_LKZ CHAR(5)&lt;br /&gt;
    RECHNUNGS_EMPF_PLZ CHAR(10)&lt;br /&gt;
    RECHNUNGS_EMPF_ORT CHAR(50)&lt;br /&gt;
    POST_LEITCODE CHAR(15)&lt;br /&gt;
    POST_ZIEL_FRACHTZENT CHAR(5)&lt;br /&gt;
    FRACHT_BRIEF CHAR(20)&lt;br /&gt;
    GEWICHT CHAR(9)&lt;br /&gt;
    NETTO_GEWICHT CHAR(9)&lt;br /&gt;
    PACK_STK_GES CHAR(10)&lt;br /&gt;
    PACK_STK_NR CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(6)&lt;br /&gt;
    PACKSTUECK_LAENGE CHAR(10)&lt;br /&gt;
    PACKSTUECK_BREITE CHAR(10)&lt;br /&gt;
    PACKSTUECK_HOEHE CHAR(10)&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECK_ID CHAR(15)&lt;br /&gt;
    ANZAHL_ARTIKEL CHAR(10)&lt;br /&gt;
    ZUSATZ_ZEILE1 CHAR(150)&lt;br /&gt;
    ZUSATZ_ZEILE2 CHAR(150)&lt;br /&gt;
    FREI_AVIS1 CHAR(62)&lt;br /&gt;
    FREI_AVIS2 CHAR(62)&lt;br /&gt;
    HV_ELEKTRONIK_ARTIKEL CHAR(1)&lt;br /&gt;
    EMPF_EMAILADRESSE CHAR(100)&lt;br /&gt;
    KOSTENSTELLE CHAR(30)&lt;br /&gt;
    DRUCKERNAME CHAR(30)&lt;br /&gt;
  DGPOSITIONS STRUCTURE&lt;br /&gt;
    UNNR CHAR(4)&lt;br /&gt;
    KLASSE CHAR(6)&lt;br /&gt;
    VPG CHAR(5)&lt;br /&gt;
    K_CODE CHAR(5)&lt;br /&gt;
    BEZEICHNUNG CHAR(110)&lt;br /&gt;
    MENGE CHAR(9)&lt;br /&gt;
    BEGRENZTE_MENGE CHAR(1)&lt;br /&gt;
    VERP_ANZAHL CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(8)&lt;br /&gt;
    NEBEN_GEFAHR CHAR(20)&lt;br /&gt;
    BUCHST640 CHAR(1)&lt;br /&gt;
    MENGEN_EINHEIT CHAR(2)&lt;br /&gt;
    BEFOERD_KAT CHAR(10)&lt;br /&gt;
    FAKTOR CHAR(10)&lt;br /&gt;
    NETTO_EXPL_MASSE CHAR(9)&lt;br /&gt;
    TUNNEL_B_CODE CHAR(10)&lt;br /&gt;
    FREIGEST_MENGE CHAR(1)&lt;br /&gt;
    FF_CODE CHAR(20)&lt;br /&gt;
  DELIVERYPOSITIONS STRUCTURE&lt;br /&gt;
    ANZAHLPOSETIKETTEN CHAR()&lt;br /&gt;
    ARTIKELBTNNR CHAR(25)&lt;br /&gt;
    ARTIKELEAN CHAR(20)&lt;br /&gt;
    ARTIKELEINHEIT CHAR(10)&lt;br /&gt;
    ARTIKELGEWICHT CHAR(9)&lt;br /&gt;
    ARTIKELMENGE CHAR(9)&lt;br /&gt;
    ARTIKELSOLLMENGE CHAR(9)&lt;br /&gt;
    ARTIKELTEXT1 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT2 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT3 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT4 CHAR(100)&lt;br /&gt;
    ARTIKELWAEHRUNG CHAR(3)&lt;br /&gt;
    ARTIKELWERT CHAR(9)&lt;br /&gt;
    CHARGEFLAG CHAR(1)&lt;br /&gt;
    KUNDENARTIKELNR CHAR(50)&lt;br /&gt;
    KUNDENBESTELLNR CHAR(50)&lt;br /&gt;
    POSAUFTRAGNR CHAR(50)&lt;br /&gt;
    POSITIONNR CHAR(40)&lt;br /&gt;
    POSLIEFERNR CHAR(40)&lt;br /&gt;
    SERIENNR CHAR(30)&lt;br /&gt;
    URSPRUNGLAND CHAR(2)&lt;br /&gt;
    ARTIKELGRUPPE CHAR(50)&lt;br /&gt;
    ARTIKELSERVICES CHAR(100)&lt;br /&gt;
    ARTIKELVOLUMEN CHAR(9)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
    TRACKING_NR CHAR(35)&lt;br /&gt;
    VERSAND_SENDUNGS_NR CHAR(20)&lt;br /&gt;
    DRUCK_DATE_TIME CHAR(10)&lt;br /&gt;
    AUSGANG_DATE_TIME CHAR(10)&lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHR_WAEHRUNG CHAR(3)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Define destination via SM59 ===&lt;br /&gt;
To set up an RFC connection in SAP, which is intended for the connection of the HVS32 shipping system, please proceed as follows:&lt;br /&gt;
# Go to transaction sm59&lt;br /&gt;
# Select the type T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Create a new connection with the &amp;quot;create&amp;quot; button&lt;br /&gt;
# Specify an RFC destination (e.g. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Set the activation type to &amp;quot;Registered server program&lt;br /&gt;
# Set a program ID (e.g. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Open the &amp;quot;MDMP &amp;amp; Unicode&amp;quot; tab&lt;br /&gt;
# Set the communication type to &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Save the settings&lt;br /&gt;
# You can test the connection via &amp;quot;Connection Test&amp;quot; once the DataGatewayServer is installed on the target system and started as a service &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6122</id>
		<title>HVS32 SAP RFC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6122"/>
		<updated>2025-04-11T09:01:08Z</updated>

		<summary type="html">&lt;p&gt;Odelice: /* Voraussetzungen */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_SAP_RFC_Interface_(Polling)]]&lt;br /&gt;
&lt;br /&gt;
= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.8.40 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP RFC Server&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Es können beliebige RFC Funktionen im DGS implementiert werden, welche von einem RFC-Client (SAP) aus aufgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Je HVS32 Funktion muss ein separater RFC Baustein genutzt werden. Die Struktur des RFC-Bausteins (Felder, Tabellen, Strukturen) ohne Implementierung muss im SAP System auf einem Applikationsserver für den DGS verfügbar sein - da die Metadaten der RFC Bausteine bei Systemstart abgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS registriert sich selbst unter einer Programm-ID an einem SAP Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
RFCServerCentralSAPGateway.png|DGS SAP/RFC Server an zentralem SAP Gateway&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in &amp;#039;&amp;#039;&amp;#039;64Bit&amp;#039;&amp;#039;&amp;#039; (sapjco3.jar + sapjco3.dll)&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ &amp;#039;&amp;#039;&amp;#039;64bit&amp;#039;&amp;#039;&amp;#039; voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
** alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
** Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* SAP RFC User mit entsprechender Berechtigung&lt;br /&gt;
** Bzgl. der Berechtigung kann man mit dem &amp;#039;&amp;#039;SAP note 460089 - Minimum authorization profiles for external RFC programs&amp;#039;&amp;#039; anfangen&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Servername / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| rfcfunctions || Liste aller RFC-Funktionsbausteinen, welche im SAP bereitgestellt werden&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im RFC Baustein als Table oder Struct definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Alle Parameter, welche an das HVS32 gesendet werden sollen, müssen in die Import-Parameter geschrieben werden. Die Rückmeldung aus dem HVS32 erfolgt in den Export-Parametern. Die Kommunikation ist bidirektional, d.h. die Rückmeldung erfolgt synchron in der gleichen Transaktion wie die Anfrage.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die VersandDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSVERSANDDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    KUNDENNR CHAR(20)&lt;br /&gt;
    ZIELADRNAME1 CHAR(50)&lt;br /&gt;
    ZIELADRNAME2 CHAR(50)&lt;br /&gt;
    ZIELADRNAME3 CHAR(50)&lt;br /&gt;
    ZIELADRSTRASSE CHAR(50)&lt;br /&gt;
    ZIELADRLKZ CHAR(5)&lt;br /&gt;
    ZIELADRPLZ CHAR(10)&lt;br /&gt;
    ZIELADRORT CHAR(50)&lt;br /&gt;
    ZIELADRREGION CHAR(20)&lt;br /&gt;
    ZIELADRBAHNHOF CHAR(30)&lt;br /&gt;
    ANSPRECHPARTNER CHAR(20)&lt;br /&gt;
    TELEFONNR CHAR(20)&lt;br /&gt;
    FAXNR CHAR(20)&lt;br /&gt;
    USTIDNR CHAR(20)&lt;br /&gt;
    ILNNR CHAR(20)&lt;br /&gt;
    AUFTRAGGEBERID CHAR(10)&lt;br /&gt;
    VERSANDARTID CHAR(10)&lt;br /&gt;
    AVISHINWEIS1 CHAR(30)&lt;br /&gt;
    AVISHINWEIS2 CHAR(30)&lt;br /&gt;
    AVISZUSATZ1 CHAR(20)&lt;br /&gt;
    AVISZUSATZ2 CHAR(20)&lt;br /&gt;
    LIEFERSCHEINNR CHAR(40)&lt;br /&gt;
    AUFTRAGNR CHAR(20)&lt;br /&gt;
    BESTELLNR CHAR(20)&lt;br /&gt;
    WARENWERT CHAR(19)&lt;br /&gt;
    WWWAEHRUNG CHAR(3)&lt;br /&gt;
    NACHNAHME CHAR(19)&lt;br /&gt;
    NNWAEHRUNG CHAR(3)&lt;br /&gt;
    NNVERMERK CHAR(1)&lt;br /&gt;
    NNVERWENDUNG CHAR(30)&lt;br /&gt;
    VERSICHERUNGSWERT CHAR(19)&lt;br /&gt;
    VWWAEHRUNG CHAR(3)&lt;br /&gt;
    FRANKATURKENNUNG CHAR(10)&lt;br /&gt;
    ZAHLUNGSBEDIGNUNG CHAR(10)&lt;br /&gt;
    ZBZOLL CHAR(1)&lt;br /&gt;
    FRACHTFUEHRERKDNR CHAR(10)&lt;br /&gt;
    SONDERDIENSTE CHAR(30)&lt;br /&gt;
    SENDUNGSINHALT CHAR(30)&lt;br /&gt;
    TERMINART CHAR(1)&lt;br /&gt;
    TERMINDATUM CHAR(10)&lt;br /&gt;
    TERMINZEIT CHAR(5)&lt;br /&gt;
    NEUTABSENDERNAME1 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME2 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME3 CHAR(30)&lt;br /&gt;
    NEUTABSENDERSTRASSE CHAR(30)&lt;br /&gt;
    NEUTABSENDERLKZ CHAR(3)&lt;br /&gt;
    NEUTABSENDERPLZ CHAR(10)&lt;br /&gt;
    NEUTABSENDERORT CHAR(30)&lt;br /&gt;
    RECHNUNGSEMPFNAME1 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME2 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME3 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFSTRASSE CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFLKZ CHAR(5)&lt;br /&gt;
    RECHNUNGSEMPFPLZ CHAR(10)&lt;br /&gt;
    RECHNUNGSEMPFORT CHAR(50)&lt;br /&gt;
    POSTLEITCODE CHAR(15)&lt;br /&gt;
    POSTZIELFRACHTZENT CHAR(5)&lt;br /&gt;
    FRACHTBRIEF CHAR(20)&lt;br /&gt;
    GEWICHT CHAR(9)&lt;br /&gt;
    NETTOGEWICHT CHAR(9)&lt;br /&gt;
    PACKSTKGES CHAR(10)&lt;br /&gt;
    PACKSTKNR CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(6)&lt;br /&gt;
    PACKSTUECKLAENGE CHAR(10)&lt;br /&gt;
    PACKSTUECKBREITE CHAR(10)&lt;br /&gt;
    PACKSTUECKHOEHE CHAR(10)&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(15)&lt;br /&gt;
    ANZAHLARTIKEL CHAR(10)&lt;br /&gt;
    ZUSATZZEILE1 CHAR(150)&lt;br /&gt;
    ZUSATZZEILE2 CHAR(150)&lt;br /&gt;
    FREIAVIS1 CHAR(62)&lt;br /&gt;
    FREIAVIS2 CHAR(62)&lt;br /&gt;
    HVELEKTRONIKARTIKEL CHAR(1)&lt;br /&gt;
    EMPFEMAILADRESSE CHAR(100)&lt;br /&gt;
    KOSTENSTELLE CHAR(30)&lt;br /&gt;
    DRUCKERNAME CHAR(30)&lt;br /&gt;
  DGPOSITIONS STRUCTURE&lt;br /&gt;
    GEFAHRGUTUNNR CHAR(4)&lt;br /&gt;
    GEFAHRGUTKLASSE CHAR(6)&lt;br /&gt;
    GEFAHRGUTVPG CHAR(5)&lt;br /&gt;
    GEFAHRGUTKCODE CHAR(5)&lt;br /&gt;
    GEFAHRGUTBEZEICHNUNG CHAR(110)&lt;br /&gt;
    GEFAHRGUTMENGE CHAR(9)&lt;br /&gt;
    GEFAHRGUTBEGRENZTEMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTVERPANZAHL CHAR(10)&lt;br /&gt;
    GEFAHRGUTVERPACKUNGSART CHAR(8)&lt;br /&gt;
    GEFAHRGUTNEBENGEFAHR CHAR(20)&lt;br /&gt;
    GEFAHRGUTBUCHST640 CHAR(1)&lt;br /&gt;
    GEFAHRGUTMENGENEINHEIT CHAR(2)&lt;br /&gt;
    GEFAHRGUTBEFOERDKAT CHAR(10)&lt;br /&gt;
    GEFAHRGUTFAKTOR CHAR(10)&lt;br /&gt;
    GEFAHRGUTNETTOEXPLMASSE CHAR(9)&lt;br /&gt;
    GEFAHRGUTTUNNELBCODE CHAR(10)&lt;br /&gt;
    GEFAHRGUTFREIGESTMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTFFCODE CHAR(20)&lt;br /&gt;
  DELIVERYPOSITIONS STRUCTURE&lt;br /&gt;
    ANZAHLPOSETIKETTEN CHAR()&lt;br /&gt;
    ARTIKELBTNNR CHAR(25)&lt;br /&gt;
    ARTIKELEAN CHAR(20)&lt;br /&gt;
    ARTIKELEINHEIT CHAR(10)&lt;br /&gt;
    ARTIKELGEWICHT CHAR(9)&lt;br /&gt;
    ARTIKELMENGE CHAR(9)&lt;br /&gt;
    ARTIKELSOLLMENGE CHAR(9)&lt;br /&gt;
    ARTIKELTEXT1 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT2 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT3 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT4 CHAR(100)&lt;br /&gt;
    ARTIKELWAEHRUNG CHAR(3)&lt;br /&gt;
    ARTIKELWERT CHAR(9)&lt;br /&gt;
    CHARGEFLAG CHAR(1)&lt;br /&gt;
    KUNDENARTIKELNR CHAR(50)&lt;br /&gt;
    KUNDENBESTELLNR CHAR(50)&lt;br /&gt;
    POSAUFTRAGNR CHAR(50)&lt;br /&gt;
    POSITIONNR CHAR(40)&lt;br /&gt;
    POSLIEFERNR CHAR(40)&lt;br /&gt;
    SERIENNR CHAR(30)&lt;br /&gt;
    URSPRUNGLAND CHAR(2)&lt;br /&gt;
    ARTIKELGRUPPE CHAR(50)&lt;br /&gt;
    ARTIKELSERVICES CHAR(100)&lt;br /&gt;
    ARTIKELVOLUMEN CHAR(9)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    VERSANDSENDUNGSNR CHAR(20)&lt;br /&gt;
    DRUCKDATETIME CHAR(10)&lt;br /&gt;
    AUSGANGDATETIME CHAR(10)&lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6121</id>
		<title>HVS32 SAP RFC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=6121"/>
		<updated>2025-04-11T09:00:56Z</updated>

		<summary type="html">&lt;p&gt;Odelice: /* Notwendige SAP-Komponenten/-Parameter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_SAP_RFC_Interface_(Polling)]]&lt;br /&gt;
&lt;br /&gt;
= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.6.0.550 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP RFC Server&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Es können beliebige RFC Funktionen im DGS implementiert werden, welche von einem RFC-Client (SAP) aus aufgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Je HVS32 Funktion muss ein separater RFC Baustein genutzt werden. Die Struktur des RFC-Bausteins (Felder, Tabellen, Strukturen) ohne Implementierung muss im SAP System auf einem Applikationsserver für den DGS verfügbar sein - da die Metadaten der RFC Bausteine bei Systemstart abgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS registriert sich selbst unter einer Programm-ID an einem SAP Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
RFCServerCentralSAPGateway.png|DGS SAP/RFC Server an zentralem SAP Gateway&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in &amp;#039;&amp;#039;&amp;#039;64Bit&amp;#039;&amp;#039;&amp;#039; (sapjco3.jar + sapjco3.dll)&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ &amp;#039;&amp;#039;&amp;#039;64bit&amp;#039;&amp;#039;&amp;#039; voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
** alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
** Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* SAP RFC User mit entsprechender Berechtigung&lt;br /&gt;
** Bzgl. der Berechtigung kann man mit dem &amp;#039;&amp;#039;SAP note 460089 - Minimum authorization profiles for external RFC programs&amp;#039;&amp;#039; anfangen&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Servername / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| rfcfunctions || Liste aller RFC-Funktionsbausteinen, welche im SAP bereitgestellt werden&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im RFC Baustein als Table oder Struct definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Alle Parameter, welche an das HVS32 gesendet werden sollen, müssen in die Import-Parameter geschrieben werden. Die Rückmeldung aus dem HVS32 erfolgt in den Export-Parametern. Die Kommunikation ist bidirektional, d.h. die Rückmeldung erfolgt synchron in der gleichen Transaktion wie die Anfrage.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die VersandDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSVERSANDDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    KUNDENNR CHAR(20)&lt;br /&gt;
    ZIELADRNAME1 CHAR(50)&lt;br /&gt;
    ZIELADRNAME2 CHAR(50)&lt;br /&gt;
    ZIELADRNAME3 CHAR(50)&lt;br /&gt;
    ZIELADRSTRASSE CHAR(50)&lt;br /&gt;
    ZIELADRLKZ CHAR(5)&lt;br /&gt;
    ZIELADRPLZ CHAR(10)&lt;br /&gt;
    ZIELADRORT CHAR(50)&lt;br /&gt;
    ZIELADRREGION CHAR(20)&lt;br /&gt;
    ZIELADRBAHNHOF CHAR(30)&lt;br /&gt;
    ANSPRECHPARTNER CHAR(20)&lt;br /&gt;
    TELEFONNR CHAR(20)&lt;br /&gt;
    FAXNR CHAR(20)&lt;br /&gt;
    USTIDNR CHAR(20)&lt;br /&gt;
    ILNNR CHAR(20)&lt;br /&gt;
    AUFTRAGGEBERID CHAR(10)&lt;br /&gt;
    VERSANDARTID CHAR(10)&lt;br /&gt;
    AVISHINWEIS1 CHAR(30)&lt;br /&gt;
    AVISHINWEIS2 CHAR(30)&lt;br /&gt;
    AVISZUSATZ1 CHAR(20)&lt;br /&gt;
    AVISZUSATZ2 CHAR(20)&lt;br /&gt;
    LIEFERSCHEINNR CHAR(40)&lt;br /&gt;
    AUFTRAGNR CHAR(20)&lt;br /&gt;
    BESTELLNR CHAR(20)&lt;br /&gt;
    WARENWERT CHAR(19)&lt;br /&gt;
    WWWAEHRUNG CHAR(3)&lt;br /&gt;
    NACHNAHME CHAR(19)&lt;br /&gt;
    NNWAEHRUNG CHAR(3)&lt;br /&gt;
    NNVERMERK CHAR(1)&lt;br /&gt;
    NNVERWENDUNG CHAR(30)&lt;br /&gt;
    VERSICHERUNGSWERT CHAR(19)&lt;br /&gt;
    VWWAEHRUNG CHAR(3)&lt;br /&gt;
    FRANKATURKENNUNG CHAR(10)&lt;br /&gt;
    ZAHLUNGSBEDIGNUNG CHAR(10)&lt;br /&gt;
    ZBZOLL CHAR(1)&lt;br /&gt;
    FRACHTFUEHRERKDNR CHAR(10)&lt;br /&gt;
    SONDERDIENSTE CHAR(30)&lt;br /&gt;
    SENDUNGSINHALT CHAR(30)&lt;br /&gt;
    TERMINART CHAR(1)&lt;br /&gt;
    TERMINDATUM CHAR(10)&lt;br /&gt;
    TERMINZEIT CHAR(5)&lt;br /&gt;
    NEUTABSENDERNAME1 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME2 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME3 CHAR(30)&lt;br /&gt;
    NEUTABSENDERSTRASSE CHAR(30)&lt;br /&gt;
    NEUTABSENDERLKZ CHAR(3)&lt;br /&gt;
    NEUTABSENDERPLZ CHAR(10)&lt;br /&gt;
    NEUTABSENDERORT CHAR(30)&lt;br /&gt;
    RECHNUNGSEMPFNAME1 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME2 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME3 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFSTRASSE CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFLKZ CHAR(5)&lt;br /&gt;
    RECHNUNGSEMPFPLZ CHAR(10)&lt;br /&gt;
    RECHNUNGSEMPFORT CHAR(50)&lt;br /&gt;
    POSTLEITCODE CHAR(15)&lt;br /&gt;
    POSTZIELFRACHTZENT CHAR(5)&lt;br /&gt;
    FRACHTBRIEF CHAR(20)&lt;br /&gt;
    GEWICHT CHAR(9)&lt;br /&gt;
    NETTOGEWICHT CHAR(9)&lt;br /&gt;
    PACKSTKGES CHAR(10)&lt;br /&gt;
    PACKSTKNR CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(6)&lt;br /&gt;
    PACKSTUECKLAENGE CHAR(10)&lt;br /&gt;
    PACKSTUECKBREITE CHAR(10)&lt;br /&gt;
    PACKSTUECKHOEHE CHAR(10)&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(15)&lt;br /&gt;
    ANZAHLARTIKEL CHAR(10)&lt;br /&gt;
    ZUSATZZEILE1 CHAR(150)&lt;br /&gt;
    ZUSATZZEILE2 CHAR(150)&lt;br /&gt;
    FREIAVIS1 CHAR(62)&lt;br /&gt;
    FREIAVIS2 CHAR(62)&lt;br /&gt;
    HVELEKTRONIKARTIKEL CHAR(1)&lt;br /&gt;
    EMPFEMAILADRESSE CHAR(100)&lt;br /&gt;
    KOSTENSTELLE CHAR(30)&lt;br /&gt;
    DRUCKERNAME CHAR(30)&lt;br /&gt;
  DGPOSITIONS STRUCTURE&lt;br /&gt;
    GEFAHRGUTUNNR CHAR(4)&lt;br /&gt;
    GEFAHRGUTKLASSE CHAR(6)&lt;br /&gt;
    GEFAHRGUTVPG CHAR(5)&lt;br /&gt;
    GEFAHRGUTKCODE CHAR(5)&lt;br /&gt;
    GEFAHRGUTBEZEICHNUNG CHAR(110)&lt;br /&gt;
    GEFAHRGUTMENGE CHAR(9)&lt;br /&gt;
    GEFAHRGUTBEGRENZTEMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTVERPANZAHL CHAR(10)&lt;br /&gt;
    GEFAHRGUTVERPACKUNGSART CHAR(8)&lt;br /&gt;
    GEFAHRGUTNEBENGEFAHR CHAR(20)&lt;br /&gt;
    GEFAHRGUTBUCHST640 CHAR(1)&lt;br /&gt;
    GEFAHRGUTMENGENEINHEIT CHAR(2)&lt;br /&gt;
    GEFAHRGUTBEFOERDKAT CHAR(10)&lt;br /&gt;
    GEFAHRGUTFAKTOR CHAR(10)&lt;br /&gt;
    GEFAHRGUTNETTOEXPLMASSE CHAR(9)&lt;br /&gt;
    GEFAHRGUTTUNNELBCODE CHAR(10)&lt;br /&gt;
    GEFAHRGUTFREIGESTMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTFFCODE CHAR(20)&lt;br /&gt;
  DELIVERYPOSITIONS STRUCTURE&lt;br /&gt;
    ANZAHLPOSETIKETTEN CHAR()&lt;br /&gt;
    ARTIKELBTNNR CHAR(25)&lt;br /&gt;
    ARTIKELEAN CHAR(20)&lt;br /&gt;
    ARTIKELEINHEIT CHAR(10)&lt;br /&gt;
    ARTIKELGEWICHT CHAR(9)&lt;br /&gt;
    ARTIKELMENGE CHAR(9)&lt;br /&gt;
    ARTIKELSOLLMENGE CHAR(9)&lt;br /&gt;
    ARTIKELTEXT1 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT2 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT3 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT4 CHAR(100)&lt;br /&gt;
    ARTIKELWAEHRUNG CHAR(3)&lt;br /&gt;
    ARTIKELWERT CHAR(9)&lt;br /&gt;
    CHARGEFLAG CHAR(1)&lt;br /&gt;
    KUNDENARTIKELNR CHAR(50)&lt;br /&gt;
    KUNDENBESTELLNR CHAR(50)&lt;br /&gt;
    POSAUFTRAGNR CHAR(50)&lt;br /&gt;
    POSITIONNR CHAR(40)&lt;br /&gt;
    POSLIEFERNR CHAR(40)&lt;br /&gt;
    SERIENNR CHAR(30)&lt;br /&gt;
    URSPRUNGLAND CHAR(2)&lt;br /&gt;
    ARTIKELGRUPPE CHAR(50)&lt;br /&gt;
    ARTIKELSERVICES CHAR(100)&lt;br /&gt;
    ARTIKELVOLUMEN CHAR(9)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    VERSANDSENDUNGSNR CHAR(20)&lt;br /&gt;
    DRUCKDATETIME CHAR(10)&lt;br /&gt;
    AUSGANGDATETIME CHAR(10)&lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_IDOC_Schnittstelle_(Automatik-Polling)&amp;diff=6120</id>
		<title>HVS32 SAP IDOC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_IDOC_Schnittstelle_(Automatik-Polling)&amp;diff=6120"/>
		<updated>2025-04-11T09:00:45Z</updated>

		<summary type="html">&lt;p&gt;Odelice: /* Notwendige SAP-Komponenten/-Parameter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.8.40 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP IDoc Server, (optional für Rückmeldungen via IDoc: SAP IDoc Client)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die Daten werden im IDoc-Format über das auf TCP/IP basierende SAP-RFC-Protokoll (Remote Function Call) vom DGS empfangen. Je HVS32-Funktion muss ein eigener IDoc Type verwendet werden. Die IDoc-Typen können sowohl Basistypen, individualisierte Basistypen als auch komplett individuelle IDocs sein.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Damit vom SAP-System IDocs an den DataGatewayServer gesendet werden können, registriert sich dieser selbständig als externes RFC-Server-Programm (unter einer Programm-ID) bei einem SAP-Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Nach dem Erzeugen des IDoc, wird dieses über einen transaktionsbasierten RFC an den DataGatewayServer gesendet. Dabei wird nicht auf eine Antwort gewartet, das heißt der Aufruf erfolgt asynchron.&amp;lt;br&amp;gt;&lt;br /&gt;
Sobald das IDoc im DGS ankommt, wird anhand der enthaltenen Steuerinformationen eine passende HVS32-Station zur Verarbeitung gesucht. Falls keine Station zur Verfügung steht, wird das IDoc als fehlerhaft protokolliert und verworfen. Im anderen Fall werden die Daten in das spezielle HVS32-XML-Format umgesetzt, das schließlich an die ausgewählte HVS32-Station zur Verarbeitung weitergereicht wird.&lt;br /&gt;
Im HVS32 findet eine sequentielle Verarbeitung aller ankommenden Aufträge statt. Somit kann eine Station nicht mehrere Aufträge parallel verarbeiten. Anschließend werden die Rückmeldedaten an den DGS gegeben, welcher anhand dieser Information das IDoc als erledigt markiert.&amp;lt;br&amp;gt;&lt;br /&gt;
Wie im Ablauf zu sehen ist, wird keine direkte Rückmeldung an SAP geschickt. Der Grund dafür liegt bei der asynchronen Verarbeitung von IDocs, wodurch kein Anfrage-Antwort-Dialog zwischen dem Versandsystem und dem SAP-System zustande kommt. Dennoch besteht grundsätzlich die Möglichkeit die Rückmeldedaten (wie z.B. Paketnummer) über ein separates IDoc nach der Verarbeitung, ebenfalls asynchron, an SAP zu senden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Sapidocablauf.jpg|Ablauf: DGS SAP/IDoc Server&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in 64Bit und &amp;quot;JIDocLib&amp;quot;&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ (64bit) voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
**alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
**Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* SAP RFC User mit entsprechender Berechtigung&lt;br /&gt;
** Bzgl. der Berechtigung kann man mit dem &amp;#039;&amp;#039;SAP note 460089 - Minimum authorization profiles for external RFC programs&amp;#039;&amp;#039; anfangen&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Server / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| IDocTypes || Liste von IDoc-Typen, die vom DataGatewayServer interpretiert werden sollen&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im IDoc als Untersegment des Packstück-Segments definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Die Kommunikation ist unidirektional, d.h. eine Rückmeldung aus dem HVS32 erfolgt nicht bzw. asynchron in einer eigenen Trasaktion&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
* DELVRY05, DELVRY07&lt;br /&gt;
* DESADV01&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_IDOC_Schnittstelle_(Automatik-Polling)&amp;diff=6119</id>
		<title>HVS32 SAP IDOC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_IDOC_Schnittstelle_(Automatik-Polling)&amp;diff=6119"/>
		<updated>2025-04-10T07:58:24Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.8.40 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP IDoc Server, (optional für Rückmeldungen via IDoc: SAP IDoc Client)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die Daten werden im IDoc-Format über das auf TCP/IP basierende SAP-RFC-Protokoll (Remote Function Call) vom DGS empfangen. Je HVS32-Funktion muss ein eigener IDoc Type verwendet werden. Die IDoc-Typen können sowohl Basistypen, individualisierte Basistypen als auch komplett individuelle IDocs sein.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Damit vom SAP-System IDocs an den DataGatewayServer gesendet werden können, registriert sich dieser selbständig als externes RFC-Server-Programm (unter einer Programm-ID) bei einem SAP-Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Nach dem Erzeugen des IDoc, wird dieses über einen transaktionsbasierten RFC an den DataGatewayServer gesendet. Dabei wird nicht auf eine Antwort gewartet, das heißt der Aufruf erfolgt asynchron.&amp;lt;br&amp;gt;&lt;br /&gt;
Sobald das IDoc im DGS ankommt, wird anhand der enthaltenen Steuerinformationen eine passende HVS32-Station zur Verarbeitung gesucht. Falls keine Station zur Verfügung steht, wird das IDoc als fehlerhaft protokolliert und verworfen. Im anderen Fall werden die Daten in das spezielle HVS32-XML-Format umgesetzt, das schließlich an die ausgewählte HVS32-Station zur Verarbeitung weitergereicht wird.&lt;br /&gt;
Im HVS32 findet eine sequentielle Verarbeitung aller ankommenden Aufträge statt. Somit kann eine Station nicht mehrere Aufträge parallel verarbeiten. Anschließend werden die Rückmeldedaten an den DGS gegeben, welcher anhand dieser Information das IDoc als erledigt markiert.&amp;lt;br&amp;gt;&lt;br /&gt;
Wie im Ablauf zu sehen ist, wird keine direkte Rückmeldung an SAP geschickt. Der Grund dafür liegt bei der asynchronen Verarbeitung von IDocs, wodurch kein Anfrage-Antwort-Dialog zwischen dem Versandsystem und dem SAP-System zustande kommt. Dennoch besteht grundsätzlich die Möglichkeit die Rückmeldedaten (wie z.B. Paketnummer) über ein separates IDoc nach der Verarbeitung, ebenfalls asynchron, an SAP zu senden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Sapidocablauf.jpg|Ablauf: DGS SAP/IDoc Server&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in 64Bit und &amp;quot;JIDocLib&amp;quot;&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ (64bit) voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
**alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
**Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Server / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| IDocTypes || Liste von IDoc-Typen, die vom DataGatewayServer interpretiert werden sollen&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im IDoc als Untersegment des Packstück-Segments definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Die Kommunikation ist unidirektional, d.h. eine Rückmeldung aus dem HVS32 erfolgt nicht bzw. asynchron in einer eigenen Trasaktion&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
* DELVRY05, DELVRY07&lt;br /&gt;
* DESADV01&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_IDOC_Schnittstelle_(Automatik-Polling)&amp;diff=6118</id>
		<title>HVS32 SAP IDOC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_IDOC_Schnittstelle_(Automatik-Polling)&amp;diff=6118"/>
		<updated>2025-04-10T07:57:41Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.6.0.550 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP IDoc Server, (optional für Rückmeldungen via IDoc: SAP IDoc Client)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die Daten werden im IDoc-Format über das auf TCP/IP basierende SAP-RFC-Protokoll (Remote Function Call) vom DGS empfangen. Je HVS32-Funktion muss ein eigener IDoc Type verwendet werden. Die IDoc-Typen können sowohl Basistypen, individualisierte Basistypen als auch komplett individuelle IDocs sein.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Damit vom SAP-System IDocs an den DataGatewayServer gesendet werden können, registriert sich dieser selbständig als externes RFC-Server-Programm (unter einer Programm-ID) bei einem SAP-Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Nach dem Erzeugen des IDoc, wird dieses über einen transaktionsbasierten RFC an den DataGatewayServer gesendet. Dabei wird nicht auf eine Antwort gewartet, das heißt der Aufruf erfolgt asynchron.&amp;lt;br&amp;gt;&lt;br /&gt;
Sobald das IDoc im DGS ankommt, wird anhand der enthaltenen Steuerinformationen eine passende HVS32-Station zur Verarbeitung gesucht. Falls keine Station zur Verfügung steht, wird das IDoc als fehlerhaft protokolliert und verworfen. Im anderen Fall werden die Daten in das spezielle HVS32-XML-Format umgesetzt, das schließlich an die ausgewählte HVS32-Station zur Verarbeitung weitergereicht wird.&lt;br /&gt;
Im HVS32 findet eine sequentielle Verarbeitung aller ankommenden Aufträge statt. Somit kann eine Station nicht mehrere Aufträge parallel verarbeiten. Anschließend werden die Rückmeldedaten an den DGS gegeben, welcher anhand dieser Information das IDoc als erledigt markiert.&amp;lt;br&amp;gt;&lt;br /&gt;
Wie im Ablauf zu sehen ist, wird keine direkte Rückmeldung an SAP geschickt. Der Grund dafür liegt bei der asynchronen Verarbeitung von IDocs, wodurch kein Anfrage-Antwort-Dialog zwischen dem Versandsystem und dem SAP-System zustande kommt. Dennoch besteht grundsätzlich die Möglichkeit die Rückmeldedaten (wie z.B. Paketnummer) über ein separates IDoc nach der Verarbeitung, ebenfalls asynchron, an SAP zu senden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Sapidocablauf.jpg|Ablauf: DGS SAP/IDoc Server&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in 64Bit und &amp;quot;JIDocLib&amp;quot;&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ (64bit) voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
**alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
**Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Server / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| IDocTypes || Liste von IDoc-Typen, die vom DataGatewayServer interpretiert werden sollen&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im IDoc als Untersegment des Packstück-Segments definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Die Kommunikation ist unidirektional, d.h. eine Rückmeldung aus dem HVS32 erfolgt nicht bzw. asynchron in einer eigenen Trasaktion&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
* DELVRY05, DELVRY07&lt;br /&gt;
* DESADV01&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6078</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6078"/>
		<updated>2025-02-14T09:23:09Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
Please make sure that the certificate chain in the provided certificate is complete.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To request the initial tokens we offer multiple options.&lt;br /&gt;
&lt;br /&gt;
You can either request the tokens via Authorization Basic, in which the ClientID + ClientSecret are exposed in the HTTP header.&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another option is to request the tokens via JWT. In this option the ClientID is within the payload and the JWT is signed with the ClientSecret. This option offers additional securities, since the ClientSecret itself is never exposed.&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div&amp;gt;&amp;#039;&amp;#039;&amp;#039;Example of token request (generating access and refresh tokens with JWT)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request via JWT (jwt-bearer) the ClientID is within the payload as &amp;#039;&amp;#039;sub&amp;#039;&amp;#039; and signed with ClientSecret. The JWT must be transmitted in the HTTP header &amp;#039;&amp;#039;client_assertion&amp;#039;&amp;#039;. To use JWT authentification the HTTP header &amp;#039;&amp;#039;client_assertion_type&amp;#039;&amp;#039; with value &amp;#039;&amp;#039;jwt-bearer&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&lt;br /&gt;
In this example following &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; - &amp;#039;&amp;#039;huF3sPp5g5zUXP70bQ3O&amp;#039;&amp;#039; - was used.&lt;br /&gt;
&lt;br /&gt;
Following &amp;#039;&amp;#039;&amp;#039;ClientSecret&amp;#039;&amp;#039;&amp;#039; was used - &amp;#039;&amp;#039;yX2[K2DC*CjvUI3Us!eCrM@B%5OHJ@U5JCw+)Jv1b+3@1f[?YOw]mxmc(Aes)K5N&amp;#039;&amp;#039;&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
client_assertion_type: jwt-bearer&lt;br /&gt;
client_assertion: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJodUYzc1BwNWc1elVYUDcwYlEzTyIsIm5hbWUiOiJIZWlkbGVyIFN0cmljaGNvZGUgR21iSCBURVNUIiwiaWF0IjoxODE2MjM5MDIyfQ.xKwD4wnQud55LVqvs47Sy0jKhpbxb0JVZtgMWWbjNKo&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;br /&gt;
&lt;br /&gt;
==Managing Client Credentials in the DGS==&lt;br /&gt;
The client credentials are managed in the DataGatewayServer. You can create new credentials or delete existing ones.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this, start the Credentials Configurator (.exe) located in the installation directory of the DataGatewayServer.&lt;br /&gt;
===Config===&lt;br /&gt;
[[File:Authorization Credentials 001.png|thumb|right|Credentials Configurator - config]]&lt;br /&gt;
On this screen, general configurations can be made.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;If this option is active, the number of invalid authentication attempts will be counted. After &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; within &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039;, all credentials will be locked.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;If this option is active when using OAuth2.0 CC, a &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; will be triggered if a REFRESH TOKEN is reused multiple times. This action deactivates all ACCESS and REFRESH TOKENS, requiring new tokens to be requested via client credentials. Additionally, the DGS Configurator can be configured to send an email notification in the event of a CODE RED.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock Credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;With this button, all credentials can be locked or unlocked. For instance, if all client credentials were locked due to the &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; option, they can be unlocked here. This action takes effect immediately without needing to save.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;This button persistently saves the settings and credentials. The options and credentials only become active after saving. A DGS restart is not required.&lt;br /&gt;
===Managing Credentials===&lt;br /&gt;
[[File:Authorization Credentials 002.png|thumb|right|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[File:Authorization Credentials 003.png|thumb|right|Enter Username / ClientID]]&lt;br /&gt;
[[File:Authorization Credentials 004.png|thumb|right|Show Credentials Dialog]]&lt;br /&gt;
To manage your credentials, select the appropriate tab for the authentication method configured in the DGS (e.g., OAuth2.0 CC).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;create new credentials. Note that the password or client secret will only be displayed once in a dialog. Be sure to copy it to a secure location and ensure no unauthorized persons have access to it.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;assign a new password or client secret. As with the add function, the password or client secret will only be displayed once in a dialog.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;remove the selected credentials.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6077</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6077"/>
		<updated>2025-02-14T09:22:46Z</updated>

		<summary type="html">&lt;p&gt;Odelice: jwt for oauth2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[null]]&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
Please make sure that the certificate chain in the provided certificate is complete.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To request the initial tokens we offer multiple options.&lt;br /&gt;
&lt;br /&gt;
You can either request the tokens via Authorization Basic, in which the ClientID + ClientSecret are exposed in the HTTP header.&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another option is to request the tokens via JWT. In this option the ClientID is within the payload and the JWT is signed with the ClientSecret. This option offers additional securities, since the ClientSecret itself is never exposed.&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&amp;lt;div&amp;gt;&amp;#039;&amp;#039;&amp;#039;Example of token request (generating access and refresh tokens with JWT)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request via JWT (jwt-bearer) the ClientID is within the payload as &amp;#039;&amp;#039;sub&amp;#039;&amp;#039; and signed with ClientSecret. The JWT must be transmitted in the HTTP header &amp;#039;&amp;#039;client_assertion&amp;#039;&amp;#039;. To use JWT authentification the HTTP header &amp;#039;&amp;#039;client_assertion_type&amp;#039;&amp;#039; with value &amp;#039;&amp;#039;jwt-bearer&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&lt;br /&gt;
In this example following &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; - &amp;#039;&amp;#039;huF3sPp5g5zUXP70bQ3O&amp;#039;&amp;#039; - was used.&lt;br /&gt;
&lt;br /&gt;
Following &amp;#039;&amp;#039;&amp;#039;ClientSecret&amp;#039;&amp;#039;&amp;#039; was used - &amp;#039;&amp;#039;yX2[K2DC*CjvUI3Us!eCrM@B%5OHJ@U5JCw+)Jv1b+3@1f[?YOw]mxmc(Aes)K5N&amp;#039;&amp;#039;&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
client_assertion_type: jwt-bearer&lt;br /&gt;
client_assertion: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJodUYzc1BwNWc1elVYUDcwYlEzTyIsIm5hbWUiOiJIZWlkbGVyIFN0cmljaGNvZGUgR21iSCBURVNUIiwiaWF0IjoxODE2MjM5MDIyfQ.xKwD4wnQud55LVqvs47Sy0jKhpbxb0JVZtgMWWbjNKo&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;br /&gt;
&lt;br /&gt;
==Managing Client Credentials in the DGS==&lt;br /&gt;
The client credentials are managed in the DataGatewayServer. You can create new credentials or delete existing ones.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this, start the Credentials Configurator (.exe) located in the installation directory of the DataGatewayServer.&lt;br /&gt;
===Config===&lt;br /&gt;
[[File:Authorization Credentials 001.png|thumb|right|Credentials Configurator - config]]&lt;br /&gt;
On this screen, general configurations can be made.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;If this option is active, the number of invalid authentication attempts will be counted. After &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; within &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039;, all credentials will be locked.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;If this option is active when using OAuth2.0 CC, a &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; will be triggered if a REFRESH TOKEN is reused multiple times. This action deactivates all ACCESS and REFRESH TOKENS, requiring new tokens to be requested via client credentials. Additionally, the DGS Configurator can be configured to send an email notification in the event of a CODE RED.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock Credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;With this button, all credentials can be locked or unlocked. For instance, if all client credentials were locked due to the &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; option, they can be unlocked here. This action takes effect immediately without needing to save.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;This button persistently saves the settings and credentials. The options and credentials only become active after saving. A DGS restart is not required.&lt;br /&gt;
===Managing Credentials===&lt;br /&gt;
[[File:Authorization Credentials 002.png|thumb|right|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[File:Authorization Credentials 003.png|thumb|right|Enter Username / ClientID]]&lt;br /&gt;
[[File:Authorization Credentials 004.png|thumb|right|Show Credentials Dialog]]&lt;br /&gt;
To manage your credentials, select the appropriate tab for the authentication method configured in the DGS (e.g., OAuth2.0 CC).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;create new credentials. Note that the password or client secret will only be displayed once in a dialog. Be sure to copy it to a secure location and ensure no unauthorized persons have access to it.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;assign a new password or client secret. As with the add function, the password or client secret will only be displayed once in a dialog.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;remove the selected credentials.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6076</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6076"/>
		<updated>2025-02-14T09:05:37Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Interfaces:_Security_Levels_and_Authentication]]&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&lt;br /&gt;
&lt;br /&gt;
Für die Verschlüsselung wird jeweils ein Zertifikat mit zugehörigem Private Key benötigt. Die folgenden Zertifikatsformate werden unterstützt:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zertifikate:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der oder *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, oder *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
Stellen Sie sicher, dass falls vorhanden die Zertifikatskette vollständig im Zertifikat hinterlegt ist.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&amp;lt;br&amp;gt;Es wird &amp;#039;&amp;#039;&amp;#039;mindestens&amp;#039;&amp;#039;&amp;#039; die DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Bei der initialen Tokenanfrage stehen verschiedene zwei Möglichkeiten zum Abrufen bereit.&lt;br /&gt;
&lt;br /&gt;
Zum einen kann man die Token über die Authorization Basic anfragen, bei welchem die ClientID + ClientSecret im HTTP-Header mitgegeben werden.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;Eine weitere Variante die Token abzurufen ist über einen JWT. Bei dieser Methode wird die ClientID im Payload vom JWT übermittelt und das JWT selbst mit dem ClientSecret signiert. Diese Möglichkeit bietet eine zusätzliche Sicherheit, da dass ClientSecret selbst nie exposed wird.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken über JWT generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage &amp;#039;&amp;#039;&amp;#039;JWT (jwt-bearer)&amp;#039;&amp;#039;&amp;#039; muss die Client-ID und das Client-Secret in einem JWT übermittelt werden. Dabei wird die &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; im JWT Payload als &amp;quot;sub&amp;quot; übermittelt und mit dem ClientSecret signiert. Das JWT wird Im HTTP-Header als &amp;#039;&amp;#039;client_assertion&amp;#039;&amp;#039; übermittelt. Die Anfrage über das JWT erfolgt über den HTTP-Header &amp;#039;&amp;#039;client_assertion_type&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&lt;br /&gt;
In diesem Beispiel wurde die &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; - &amp;#039;&amp;#039;huF3sPp5g5zUXP70bQ3O&amp;#039;&amp;#039; - verwendet.&lt;br /&gt;
&lt;br /&gt;
Das &amp;#039;&amp;#039;&amp;#039;ClientSecret&amp;#039;&amp;#039;&amp;#039; lautet - &amp;#039;&amp;#039;yX2[K2DC*CjvUI3Us!eCrM@B%5OHJ@U5JCw+)Jv1b+3@1f[?YOw]mxmc(Aes)K5N&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
client_assertion_type: jwt-bearer&lt;br /&gt;
client_assertion: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJodUYzc1BwNWc1elVYUDcwYlEzTyIsIm5hbWUiOiJIZWlkbGVyIFN0cmljaGNvZGUgR21iSCBURVNUIiwiaWF0IjoxODE2MjM5MDIyfQ.xKwD4wnQud55LVqvs47Sy0jKhpbxb0JVZtgMWWbjNKo&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
Diese Authentifizierungs-Methode ist ausschließlich über das Authentifzierungssystem [[IRIS_Cloudsystem|IRIS Cloudsystem]] möglich.&lt;br /&gt;
&lt;br /&gt;
==Client Credentials im DGS verwalten==&lt;br /&gt;
Die Client Credentials werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&amp;lt;br&amp;gt;&lt;br /&gt;
Dazu muss im Installationsverzeichnis des DataGatewayServer der Credentials-Configurator(.exe) gestartet werden.&lt;br /&gt;
===Config===&lt;br /&gt;
[[Datei:Authorization Credentials 001.png|mini|rechts|Credentials Configurator - config]]&lt;br /&gt;
Hier können allgemeine Konfigurationen vorgenommen werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option aktiv ist, wird die Anzahl der ungültigen Authentifizierungen gezählt und nach &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; innerhalb von &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039; werden alle Credentials gesperrt&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option bei der Nutzung von OAuth2.0 CC aktiv ist, wird bei mehrfachen verwenden eines REFRESH TOKENS ein &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; ausgelöst. Hierbei werden alle ACCESS und REFRESH TOKENS deaktiviert und es müssen neue Tokens via Client Credentials angefordert werden. Zusätzlich kann im DGS Konfigurator das Versenden einer E-Mail bei einem CODE RED konfiguriert werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Über diesen Button können alle Credentials gesperrt oder entsperrt werden. Wenn z.b. durch die Option &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; alle Client Credentials gesperrt wurden, können diese somit wieder entsperrt werden. Diese Option greift sofort, ohne speichern.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;Mit diesem Button werden die Einstellungen und Credentials persistent gespeichert. Erst nach dem Speichern werden die Optionen und Credentials aktiv. Ein DGS Neustart ist nicht notwendig.&lt;br /&gt;
===Credentials verwalten===&lt;br /&gt;
[[Datei:Authorization Credentials 002.png|mini|rechts|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[Datei:Authorization Credentials 003.png|mini|rechts|Enter Username / ClientID]]&lt;br /&gt;
[[Datei:Authorization Credentials 004.png|mini|rechts|Show Credentials Dialog]]&lt;br /&gt;
Um Ihre Credentials zu verwalten, wählen Sie den passenden Reiter zu Ihrer im DGS konfigurierten Authentifizierungs-Methode (z.B. OAuth2.0 CC)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie neue Credentials anlegen. Beachten Sie, dass das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt wird. Kopieren Sie es daher in einen sicheren Platz und stellen Sie sicher, dass keine unautorisierten Personen darauf Zugriff haben.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; bzw. &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie ein neues Passwort bzw. Client Secret vergeben. Wie bei der add Funktion, wird das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie die die ausgewählten Credentials entfernen.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6075</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6075"/>
		<updated>2025-02-14T09:04:51Z</updated>

		<summary type="html">&lt;p&gt;Odelice: tokenanfrage über jwt&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[null]]&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&lt;br /&gt;
&lt;br /&gt;
Für die Verschlüsselung wird jeweils ein Zertifikat mit zugehörigem Private Key benötigt. Die folgenden Zertifikatsformate werden unterstützt:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zertifikate:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der oder *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, oder *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
Stellen Sie sicher, dass falls vorhanden die Zertifikatskette vollständig im Zertifikat hinterlegt ist.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&amp;lt;br&amp;gt;Es wird &amp;#039;&amp;#039;&amp;#039;mindestens&amp;#039;&amp;#039;&amp;#039; die DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Bei der initialen Tokenanfrage stehen verschiedene zwei Möglichkeiten zum Abrufen bereit.&lt;br /&gt;
&lt;br /&gt;
Zum einen kann man die Token über die Authorization Basic anfragen, bei welchem die ClientID + ClientSecret im HTTP-Header mitgegeben werden.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;Eine weitere Variante die Token abzurufen ist über einen JWT. Bei dieser Methode wird die ClientID im Payload vom JWT übermittelt und das JWT selbst mit dem ClientSecret signiert. Diese Möglichkeit bietet eine zusätzliche Sicherheit, da dass ClientSecret selbst nie exposed wird.&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken über JWT generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage &amp;#039;&amp;#039;&amp;#039;JWT (jwt-bearer)&amp;#039;&amp;#039;&amp;#039; muss die Client-ID und das Client-Secret in einem JWT übermittelt werden. Dabei wird die &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; im JWT Payload als &amp;quot;sub&amp;quot; übermittelt und mit dem ClientSecret signiert. Das JWT wird Im HTTP-Header als &amp;#039;&amp;#039;client_assertion&amp;#039;&amp;#039; übermittelt. Die Anfrage über das JWT erfolgt über den HTTP-Header &amp;#039;&amp;#039;client_assertion_type&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&lt;br /&gt;
In diesem Beispiel wurde die &amp;#039;&amp;#039;&amp;#039;ClientID&amp;#039;&amp;#039;&amp;#039; - &amp;#039;&amp;#039;huF3sPp5g5zUXP70bQ3O&amp;#039;&amp;#039; - verwendet.&lt;br /&gt;
&lt;br /&gt;
Das &amp;#039;&amp;#039;&amp;#039;ClientSecret&amp;#039;&amp;#039;&amp;#039; lautet - &amp;#039;&amp;#039;yX2[K2DC*CjvUI3Us!eCrM@B%5OHJ@U5JCw+)Jv1b+3@1f[?YOw]mxmc(Aes)K5N&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
client_assertion_type: jwt-bearer&lt;br /&gt;
client_assertion: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJodUYzc1BwNWc1elVYUDcwYlEzTyIsIm5hbWUiOiJIZWlkbGVyIFN0cmljaGNvZGUgR21iSCBURVNUIiwiaWF0IjoxODE2MjM5MDIyfQ.xKwD4wnQud55LVqvs47Sy0jKhpbxb0JVZtgMWWbjNKo&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
Diese Authentifizierungs-Methode ist ausschließlich über das Authentifzierungssystem [[IRIS_Cloudsystem|IRIS Cloudsystem]] möglich.&lt;br /&gt;
&lt;br /&gt;
==Client Credentials im DGS verwalten==&lt;br /&gt;
Die Client Credentials werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&amp;lt;br&amp;gt;&lt;br /&gt;
Dazu muss im Installationsverzeichnis des DataGatewayServer der Credentials-Configurator(.exe) gestartet werden.&lt;br /&gt;
===Config===&lt;br /&gt;
[[Datei:Authorization Credentials 001.png|mini|rechts|Credentials Configurator - config]]&lt;br /&gt;
Hier können allgemeine Konfigurationen vorgenommen werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option aktiv ist, wird die Anzahl der ungültigen Authentifizierungen gezählt und nach &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; innerhalb von &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039; werden alle Credentials gesperrt&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option bei der Nutzung von OAuth2.0 CC aktiv ist, wird bei mehrfachen verwenden eines REFRESH TOKENS ein &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; ausgelöst. Hierbei werden alle ACCESS und REFRESH TOKENS deaktiviert und es müssen neue Tokens via Client Credentials angefordert werden. Zusätzlich kann im DGS Konfigurator das Versenden einer E-Mail bei einem CODE RED konfiguriert werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Über diesen Button können alle Credentials gesperrt oder entsperrt werden. Wenn z.b. durch die Option &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; alle Client Credentials gesperrt wurden, können diese somit wieder entsperrt werden. Diese Option greift sofort, ohne speichern.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;Mit diesem Button werden die Einstellungen und Credentials persistent gespeichert. Erst nach dem Speichern werden die Optionen und Credentials aktiv. Ein DGS Neustart ist nicht notwendig.&lt;br /&gt;
===Credentials verwalten===&lt;br /&gt;
[[Datei:Authorization Credentials 002.png|mini|rechts|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[Datei:Authorization Credentials 003.png|mini|rechts|Enter Username / ClientID]]&lt;br /&gt;
[[Datei:Authorization Credentials 004.png|mini|rechts|Show Credentials Dialog]]&lt;br /&gt;
Um Ihre Credentials zu verwalten, wählen Sie den passenden Reiter zu Ihrer im DGS konfigurierten Authentifizierungs-Methode (z.B. OAuth2.0 CC)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie neue Credentials anlegen. Beachten Sie, dass das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt wird. Kopieren Sie es daher in einen sicheren Platz und stellen Sie sicher, dass keine unautorisierten Personen darauf Zugriff haben.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; bzw. &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie ein neues Passwort bzw. Client Secret vergeben. Wie bei der add Funktion, wird das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie die die ausgewählten Credentials entfernen.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6046</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6046"/>
		<updated>2024-11-21T07:01:35Z</updated>

		<summary type="html">&lt;p&gt;Odelice: /* Authentication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
Please make sure that the certificate chain in the provided certificate is complete.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6045</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6045"/>
		<updated>2024-11-21T06:59:47Z</updated>

		<summary type="html">&lt;p&gt;Odelice: /* Authentifizierung */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Interfaces:_Security_Levels_and_Authentication]]&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&lt;br /&gt;
&lt;br /&gt;
Für die Verschlüsselung wird jeweils ein Zertifikat mit zugehörigem Private Key benötigt. Die folgenden Zertifikatsformate werden unterstützt:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zertifikate:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der oder *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, oder *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
Stellen Sie sicher, dass falls vorhanden die Zertifikatskette vollständig im Zertifikat hinterlegt ist.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&amp;lt;br&amp;gt;Es wird &amp;#039;&amp;#039;&amp;#039;mindestens&amp;#039;&amp;#039;&amp;#039; die DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
Diese Authentifizierungs-Methode ist ausschließlich über das Authentifzierungssystem [[IRIS_Cloudsystem|IRIS Cloudsystem]] möglich.&lt;br /&gt;
&lt;br /&gt;
==Client Credentials im DGS verwalten==&lt;br /&gt;
Die Client Credentials werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&amp;lt;br&amp;gt;&lt;br /&gt;
Dazu muss im Installationsverzeichnis des DataGatewayServer der Credentials-Configurator(.exe) gestartet werden.&lt;br /&gt;
===Config===&lt;br /&gt;
[[Datei:Authorization Credentials 001.png|mini|rechts|Credentials Configurator - config]]&lt;br /&gt;
Hier können allgemeine Konfigurationen vorgenommen werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option aktiv ist, wird die Anzahl der ungültigen Authentifizierungen gezählt und nach &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; innerhalb von &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039; werden alle Credentials gesperrt&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option bei der Nutzung von OAuth2.0 CC aktiv ist, wird bei mehrfachen verwenden eines REFRESH TOKENS ein &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; ausgelöst. Hierbei werden alle ACCESS und REFRESH TOKENS deaktiviert und es müssen neue Tokens via Client Credentials angefordert werden. Zusätzlich kann im DGS Konfigurator das Versenden einer E-Mail bei einem CODE RED konfiguriert werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Über diesen Button können alle Credentials gesperrt oder entsperrt werden. Wenn z.b. durch die Option &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; alle Client Credentials gesperrt wurden, können diese somit wieder entsperrt werden. Diese Option greift sofort, ohne speichern.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;Mit diesem Button werden die Einstellungen und Credentials persistent gespeichert. Erst nach dem Speichern werden die Optionen und Credentials aktiv. Ein DGS Neustart ist nicht notwendig.&lt;br /&gt;
===Credentials verwalten===&lt;br /&gt;
[[Datei:Authorization Credentials 002.png|mini|rechts|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[Datei:Authorization Credentials 003.png|mini|rechts|Enter Username / ClientID]]&lt;br /&gt;
[[Datei:Authorization Credentials 004.png|mini|rechts|Show Credentials Dialog]]&lt;br /&gt;
Um Ihre Credentials zu verwalten, wählen Sie den passenden Reiter zu Ihrer im DGS konfigurierten Authentifizierungs-Methode (z.B. OAuth2.0 CC)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie neue Credentials anlegen. Beachten Sie, dass das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt wird. Kopieren Sie es daher in einen sicheren Platz und stellen Sie sicher, dass keine unautorisierten Personen darauf Zugriff haben.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; bzw. &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie ein neues Passwort bzw. Client Secret vergeben. Wie bei der add Funktion, wird das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können die die ausgewählten Credentials entfernen.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6044</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6044"/>
		<updated>2024-11-19T10:17:07Z</updated>

		<summary type="html">&lt;p&gt;Odelice: /* Authentication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&lt;br /&gt;
The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6043</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6043"/>
		<updated>2024-11-19T10:16:56Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Interfaces:_Security_Levels_and_Authentication]]&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&lt;br /&gt;
&lt;br /&gt;
Für die Verschlüsselung wird jeweils ein Zertifikat mit zugehörigem Private Key benötigt. Die folgenden Zertifikatsformate werden unterstützt:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zertifikate:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der oder *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, oder *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&amp;lt;br&amp;gt;Es wird &amp;#039;&amp;#039;&amp;#039;mindestens&amp;#039;&amp;#039;&amp;#039; die DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.39&amp;#039;&amp;#039;&amp;#039; benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
Diese Authentifizierungs-Methode ist ausschließlich über das Authentifzierungssystem [[IRIS_Cloudsystem|IRIS Cloudsystem]] möglich.&lt;br /&gt;
&lt;br /&gt;
==Client Credentials im DGS verwalten==&lt;br /&gt;
Die Client Credentials werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&amp;lt;br&amp;gt;&lt;br /&gt;
Dazu muss im Installationsverzeichnis des DataGatewayServer der Credentials-Configurator(.exe) gestartet werden.&lt;br /&gt;
===Config===&lt;br /&gt;
[[Datei:Authorization Credentials 001.png|mini|rechts|Credentials Configurator - config]]&lt;br /&gt;
Hier können allgemeine Konfigurationen vorgenommen werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option aktiv ist, wird die Anzahl der ungültigen Authentifizierungen gezählt und nach &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; innerhalb von &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039; werden alle Credentials gesperrt&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option bei der Nutzung von OAuth2.0 CC aktiv ist, wird bei mehrfachen verwenden eines REFRESH TOKENS ein &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; ausgelöst. Hierbei werden alle ACCESS und REFRESH TOKENS deaktiviert und es müssen neue Tokens via Client Credentials angefordert werden. Zusätzlich kann im DGS Konfigurator das Versenden einer E-Mail bei einem CODE RED konfiguriert werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Über diesen Button können alle Credentials gesperrt oder entsperrt werden. Wenn z.b. durch die Option &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; alle Client Credentials gesperrt wurden, können diese somit wieder entsperrt werden. Diese Option greift sofort, ohne speichern.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;Mit diesem Button werden die Einstellungen und Credentials persistent gespeichert. Erst nach dem Speichern werden die Optionen und Credentials aktiv. Ein DGS Neustart ist nicht notwendig.&lt;br /&gt;
===Credentials verwalten===&lt;br /&gt;
[[Datei:Authorization Credentials 002.png|mini|rechts|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[Datei:Authorization Credentials 003.png|mini|rechts|Enter Username / ClientID]]&lt;br /&gt;
[[Datei:Authorization Credentials 004.png|mini|rechts|Show Credentials Dialog]]&lt;br /&gt;
Um Ihre Credentials zu verwalten, wählen Sie den passenden Reiter zu Ihrer im DGS konfigurierten Authentifizierungs-Methode (z.B. OAuth2.0 CC)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie neue Credentials anlegen. Beachten Sie, dass das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt wird. Kopieren Sie es daher in einen sicheren Platz und stellen Sie sicher, dass keine unautorisierten Personen darauf Zugriff haben.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; bzw. &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie ein neues Passwort bzw. Client Secret vergeben. Wie bei der add Funktion, wird das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können die die ausgewählten Credentials entfernen.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6042</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6042"/>
		<updated>2024-11-19T08:25:22Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&lt;br /&gt;
The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.31&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6041</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6041"/>
		<updated>2024-11-19T08:19:59Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.31&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6040</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6040"/>
		<updated>2024-11-19T08:19:52Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Interfaces:_Security_Levels_and_Authentication]]&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&lt;br /&gt;
&lt;br /&gt;
Für die Verschlüsselung wird jeweils ein Zertifikat mit zugehörigem Private Key benötigt. Die folgenden Zertifikatsformate werden unterstützt:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zertifikate:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der oder *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, oder *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&amp;lt;br&amp;gt;Es wird &amp;#039;&amp;#039;&amp;#039;mindestens&amp;#039;&amp;#039;&amp;#039; die DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.31&amp;#039;&amp;#039;&amp;#039; benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
Diese Authentifizierungs-Methode ist ausschließlich über das Authentifzierungssystem [[IRIS_Cloudsystem|IRIS Cloudsystem]] möglich.&lt;br /&gt;
&lt;br /&gt;
==Client Credentials im DGS verwalten==&lt;br /&gt;
Die Client Credentials werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&amp;lt;br&amp;gt;&lt;br /&gt;
Dazu muss im Installationsverzeichnis des DataGatewayServer der Credentials-Configurator(.exe) gestartet werden.&lt;br /&gt;
===Config===&lt;br /&gt;
[[Datei:Authorization Credentials 001.png|mini|rechts|Credentials Configurator - config]]&lt;br /&gt;
Hier können allgemeine Konfigurationen vorgenommen werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option aktiv ist, wird die Anzahl der ungültigen Authentifizierungen gezählt und nach &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; innerhalb von &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039; werden alle Credentials gesperrt&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option bei der Nutzung von OAuth2.0 CC aktiv ist, wird bei mehrfachen verwenden eines REFRESH TOKENS ein &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; ausgelöst. Hierbei werden alle ACCESS und REFRESH TOKENS deaktiviert und es müssen neue Tokens via Client Credentials angefordert werden. Zusätzlich kann im DGS Konfigurator das Versenden einer E-Mail bei einem CODE RED konfiguriert werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Über diesen Button können alle Credentials gesperrt oder entsperrt werden. Wenn z.b. durch die Option &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; alle Client Credentials gesperrt wurden, können diese somit wieder entsperrt werden. Diese Option greift sofort, ohne speichern.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;Mit diesem Button werden die Einstellungen und Credentials persistent gespeichert. Erst nach dem Speichern werden die Optionen und Credentials aktiv. Ein DGS Neustart ist nicht notwendig.&lt;br /&gt;
===Credentials verwalten===&lt;br /&gt;
[[Datei:Authorization Credentials 002.png|mini|rechts|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[Datei:Authorization Credentials 003.png|mini|rechts|Enter Username / ClientID]]&lt;br /&gt;
[[Datei:Authorization Credentials 004.png|mini|rechts|Show Credentials Dialog]]&lt;br /&gt;
Um Ihre Credentials zu verwalten, wählen Sie den passenden Reiter zu Ihrer im DGS konfigurierten Authentifizierungs-Methode (z.B. OAuth2.0 CC)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie neue Credentials anlegen. Beachten Sie, dass das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt wird. Kopieren Sie es daher in einen sicheren Platz und stellen Sie sicher, dass keine unautorisierten Personen darauf Zugriff haben.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; bzw. &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie ein neues Passwort bzw. Client Secret vergeben. Wie bei der add Funktion, wird das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können die die ausgewählten Credentials entfernen.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6039</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6039"/>
		<updated>2024-11-19T08:19:43Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.31&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6038</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6038"/>
		<updated>2024-11-19T08:19:20Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Interfaces:_Security_Levels_and_Authentication]]&lt;br /&gt;
&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&lt;br /&gt;
&lt;br /&gt;
Für die Verschlüsselung wird jeweils ein Zertifikat mit zugehörigem Private Key benötigt. Die folgenden Zertifikatsformate werden unterstützt:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zertifikate:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der oder *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, oder *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&amp;lt;br&amp;gt;Es wird &amp;#039;&amp;#039;&amp;#039;mindestens&amp;#039;&amp;#039;&amp;#039; die DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.31&amp;#039;&amp;#039;&amp;#039; benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
Diese Authentifizierungs-Methode ist ausschließlich über das Authentifzierungssystem [[IRIS_Cloudsystem|IRIS Cloudsystem]] möglich.&lt;br /&gt;
&lt;br /&gt;
==Client Credentials im DGS verwalten==&lt;br /&gt;
Die Client Credentials werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&amp;lt;br&amp;gt;&lt;br /&gt;
Dazu muss im Installationsverzeichnis des DataGatewayServer der Credentials-Configurator(.exe) gestartet werden.&lt;br /&gt;
===Config===&lt;br /&gt;
[[Datei:Authorization Credentials 001.png|mini|rechts|Credentials Configurator - config]]&lt;br /&gt;
Hier können allgemeine Konfigurationen vorgenommen werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option aktiv ist, wird die Anzahl der ungültigen Authentifizierungen gezählt und nach &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; innerhalb von &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039; werden alle Credentials gesperrt&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option bei der Nutzung von OAuth2.0 CC aktiv ist, wird bei mehrfachen verwenden eines REFRESH TOKENS ein &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; ausgelöst. Hierbei werden alle ACCESS und REFRESH TOKENS deaktiviert und es müssen neue Tokens via Client Credentials angefordert werden. Zusätzlich kann im DGS Konfigurator das Versenden einer E-Mail bei einem CODE RED konfiguriert werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Über diesen Button können alle Credentials gesperrt oder entsperrt werden. Wenn z.b. durch die Option &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; alle Client Credentials gesperrt wurden, können diese somit wieder entsperrt werden. Diese Option greift sofort, ohne speichern.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;Mit diesem Button werden die Einstellungen und Credentials persistent gespeichert. Erst nach dem Speichern werden die Optionen und Credentials aktiv. Ein DGS Neustart ist nicht notwendig.&lt;br /&gt;
===Credentials verwalten===&lt;br /&gt;
[[Datei:Authorization Credentials 002.png|mini|rechts|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[Datei:Authorization Credentials 003.png|mini|rechts|Enter Username / ClientID]]&lt;br /&gt;
[[Datei:Authorization Credentials 004.png|mini|rechts|Show Credentials Dialog]]&lt;br /&gt;
Um Ihre Credentials zu verwalten, wählen Sie den passenden Reiter zu Ihrer im DGS konfigurierten Authentifizierungs-Methode (z.B. OAuth2.0 CC)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie neue Credentials anlegen. Beachten Sie, dass das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt wird. Kopieren Sie es daher in einen sicheren Platz und stellen Sie sicher, dass keine unautorisierten Personen darauf Zugriff haben.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; bzw. &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie ein neues Passwort bzw. Client Secret vergeben. Wie bei der add Funktion, wird das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können die die ausgewählten Credentials entfernen.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6037</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6037"/>
		<updated>2024-11-19T08:18:46Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[null]]&lt;br /&gt;
&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.31&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6036</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=6036"/>
		<updated>2024-11-19T08:18:06Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[null]]&lt;br /&gt;
&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For encryption, a certificate with the corresponding private key is required. The following certificate formats are supported:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Certificates:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der, or *.p7b&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, or *.ssh (OpenSSH)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.31&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6035</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=6035"/>
		<updated>2024-11-19T08:16:36Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[null]]&lt;br /&gt;
&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&lt;br /&gt;
&lt;br /&gt;
Für die Verschlüsselung wird jeweils ein Zertifikat mit zugehörigem Private Key benötigt. Die folgenden Zertifikatsformate werden unterstützt:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zertifikate:&amp;#039;&amp;#039;&amp;#039; *.crt, *.cer, *.pem, *.der oder *.p7b&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Private Key:&amp;#039;&amp;#039;&amp;#039; *.der, *.pem, oder *.ssh (OpenSSH)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&amp;lt;br&amp;gt;Es wird &amp;#039;&amp;#039;&amp;#039;mindestens&amp;#039;&amp;#039;&amp;#039; die DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.31&amp;#039;&amp;#039;&amp;#039; benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
Diese Authentifizierungs-Methode ist ausschließlich über das Authentifzierungssystem [[IRIS_Cloudsystem|IRIS Cloudsystem]] möglich.&lt;br /&gt;
&lt;br /&gt;
==Client Credentials im DGS verwalten==&lt;br /&gt;
Die Client Credentials werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&amp;lt;br&amp;gt;&lt;br /&gt;
Dazu muss im Installationsverzeichnis des DataGatewayServer der Credentials-Configurator(.exe) gestartet werden.&lt;br /&gt;
===Config===&lt;br /&gt;
[[Datei:Authorization Credentials 001.png|mini|rechts|Credentials Configurator - config]]&lt;br /&gt;
Hier können allgemeine Konfigurationen vorgenommen werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option aktiv ist, wird die Anzahl der ungültigen Authentifizierungen gezählt und nach &amp;#039;&amp;#039;&amp;#039;max invalid logins&amp;#039;&amp;#039;&amp;#039; innerhalb von &amp;#039;&amp;#039;&amp;#039;timespan in seconds&amp;#039;&amp;#039;&amp;#039; werden alle Credentials gesperrt&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;execute CODE RED for OAuth2.0 CC&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wenn diese Option bei der Nutzung von OAuth2.0 CC aktiv ist, wird bei mehrfachen verwenden eines REFRESH TOKENS ein &amp;#039;&amp;#039;&amp;#039;CODE RED&amp;#039;&amp;#039;&amp;#039; ausgelöst. Hierbei werden alle ACCESS und REFRESH TOKENS deaktiviert und es müssen neue Tokens via Client Credentials angefordert werden. Zusätzlich kann im DGS Konfigurator das Versenden einer E-Mail bei einem CODE RED konfiguriert werden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Lock Credentials / Unlock credentials&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Über diesen Button können alle Credentials gesperrt oder entsperrt werden. Wenn z.b. durch die Option &amp;#039;&amp;#039;&amp;#039;check invalid logins&amp;#039;&amp;#039;&amp;#039; alle Client Credentials gesperrt wurden, können diese somit wieder entsperrt werden. Diese Option greift sofort, ohne speichern.&lt;br /&gt;
* Save&amp;lt;br&amp;gt;Mit diesem Button werden die Einstellungen und Credentials persistent gespeichert. Erst nach dem Speichern werden die Optionen und Credentials aktiv. Ein DGS Neustart ist nicht notwendig.&lt;br /&gt;
===Credentials verwalten===&lt;br /&gt;
[[Datei:Authorization Credentials 002.png|mini|rechts|Credentials Configurator - OAuth2.0 CC]]&lt;br /&gt;
[[Datei:Authorization Credentials 003.png|mini|rechts|Enter Username / ClientID]]&lt;br /&gt;
[[Datei:Authorization Credentials 004.png|mini|rechts|Show Credentials Dialog]]&lt;br /&gt;
Um Ihre Credentials zu verwalten, wählen Sie den passenden Reiter zu Ihrer im DGS konfigurierten Authentifizierungs-Methode (z.B. OAuth2.0 CC)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;add&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie neue Credentials anlegen. Beachten Sie, dass das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt wird. Kopieren Sie es daher in einen sicheren Platz und stellen Sie sicher, dass keine unautorisierten Personen darauf Zugriff haben.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;change secret&amp;#039;&amp;#039;&amp;#039; bzw. &amp;#039;&amp;#039;&amp;#039;change password&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können Sie ein neues Passwort bzw. Client Secret vergeben. Wie bei der add Funktion, wird das Passwort bzw. das Client-Secret nur einmalig in einem Dialog angezeigt.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;remove&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Hier können die die ausgewählten Credentials entfernen.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_RESTv2_Schnittstelle_(Automatik-Polling)&amp;diff=5832</id>
		<title>HVS32 RESTv2 Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_RESTv2_Schnittstelle_(Automatik-Polling)&amp;diff=5832"/>
		<updated>2024-07-04T07:11:26Z</updated>

		<summary type="html">&lt;p&gt;Odelice: Die Seite wurde neu angelegt: „en:HVS32_RESTv2_Interface_(Polling) &amp;#039;&amp;#039;&amp;#039;WORK IN PROGRESS!!!&amp;#039;&amp;#039;&amp;#039; &amp;lt;!-- ------------------------------------------------------------------------------- Vorausse…“&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_RESTv2_Interface_(Polling)]]&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WORK IN PROGRESS!!!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- Voraussetzungen ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.8.32 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, REST Server&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- ENDE Voraussetzungen ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= OpenAPI / Swagger =&lt;br /&gt;
[https://interface.heidler-strichcode.de?version=v2 RESTv2]&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- Funktionsbeschreibung ------------------------------------------------------------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Bei der RESTv2-Schnittstelle stellt der DataGatewayServer (DGS) einen-REST Server mit folgenden [[#Übersicht der Funktionen|Funktionen]] zur Verfügung.&lt;br /&gt;
Dieser ist in der Standardkonfiguration unter &amp;#039;&amp;#039;&amp;#039;http://&amp;lt;Servername&amp;gt;:&amp;lt;Port&amp;gt;/v2/hsc/&amp;#039;&amp;#039;&amp;#039; erreichbar. Dabei wird der Port 8081 verwendet, welcher bei Bedarf geändert werden kann.&lt;br /&gt;
&amp;lt;!-- ------------------------------------------------------------------------------- ENDE Funktionsbeschreibung ------------------------------------------------------------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Kommunikation_/_Schnittstellen&amp;diff=5831</id>
		<title>Kommunikation / Schnittstellen</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Kommunikation_/_Schnittstellen&amp;diff=5831"/>
		<updated>2024-07-04T06:58:25Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Communication_Interfaces]]&lt;br /&gt;
= HVS32 Verarbeitungs-Schnittstellen =&lt;br /&gt;
Bitte beachten Sie, dass alle Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Feldnamen /-längen /-formate können prinzipiell abweichen (außer Automatik-Polling SOAP/REST), müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&lt;br /&gt;
&lt;br /&gt;
=== Automatik-Polling ===&lt;br /&gt;
Im Automatik-Polling Modus arbeitet das Versandsystem HVS32 komplett im Hintergrund und wird vom Vorsystem via Schnittstelle angesprochen.&lt;br /&gt;
Hierbei können Funktionen wie Versandlabeldruck, Packstückstorno, Tagesabschluss, etc. getriggert werden. Eine Benutzerseitige Eingabe von Daten ist nicht erforderlich.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die Daten können mittels folgenden Schnittstellen vom Vorsystem an das HVS32 übertragen werden:&lt;br /&gt;
&lt;br /&gt;
*[[HVS32_File_Schnittstelle_(Automatik-Polling)|File (CSV, SDF, etc.)]] &lt;br /&gt;
*[[HVS32_REST_Schnittstelle_(Automatik-Polling)|RESTv1]]&lt;br /&gt;
&amp;lt;!--*[[HVS32_RESTv2_Schnittstelle_(Automatik-Polling)|RESTv2]]--&amp;gt;&lt;br /&gt;
*[https://interface.heidler-strichcode.de?version=v2 RESTv2]&lt;br /&gt;
*[[HVS32_SOAP_Schnittstelle_(Automatik-Polling)|SOAP]]&lt;br /&gt;
&amp;lt;!--*[[HVS32_ODBC_Schnittstelle_(Automatik-Polling)|ODBC]]--&amp;gt;&lt;br /&gt;
*[[HVS32_JDBC_Schnittstelle_(Automatik-Polling)|JDBC]]&lt;br /&gt;
*[[HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)|SAP RFC]]&lt;br /&gt;
*[[HVS32_SAP_IDOC_Schnittstelle_(Automatik-Polling)|SAP IDoc]]&lt;br /&gt;
*[[HVS32_Ehrhardt_%2B_Partner_LFS_Schnittstelle_(Automatik-Polling)|Ehrhardt + Partner LFS]]&lt;br /&gt;
*[[HVS32_PSI_REST_Schnittstelle_(Automatik-Polling)|PSI-REST]]&lt;br /&gt;
&amp;lt;!--*[[HVS32_Standard_Datei_Schnittstelle|Standard Datei (CSV, SDF, etc.)]]--&amp;gt;&lt;br /&gt;
&amp;lt;!--*[[HVS32_Standard_Datei_Tabellenbeschreibung|Standard Datei Tabellenbeschreibung (CSV, SDF, etc.)]]--&amp;gt;&lt;br /&gt;
=== Interaktiv ===&lt;br /&gt;
Bei einer interaktiven Verarbeitung werden die Versand-Daten in einer Erfassungsmaske des HVS32 eingetragen. Die Versand-Daten können bei diversen [[HVS32_Funktionen_Interaktiv|interaktiven Aktionen]] am Vorsystem angefragt bzw. an das Vorsystem zurück gemeldet werden.&amp;lt;br&amp;gt;&lt;br /&gt;
Dadurch hat man zum Beispiel die Möglichkeit, eine Datenanfrage nach Scannen eines Lieferscheins, Rückmeldung nach Druck eines Etiketts, Rückmeldung nach Tagesabschluss, Rückmeldung nach Storno/Freigabe durchzuführen.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mit folgendenen Schnittstellen kann bei der interaktiven Verarbeitung auf die Versand-Daten des Vorsystems zugegriffen werden:&lt;br /&gt;
&amp;lt;!--*[[HVS32_File_Schnittstelle_Lieferscheindaten_(Interaktiv)|File (Lieferscheindaten)]]--&amp;gt;&lt;br /&gt;
&amp;lt;!--*[[HVS32_File_Schnittstelle_Adressdaten_(Interaktiv)|File (Adressdaten)]]--&amp;gt;&lt;br /&gt;
*[[HVS32_REST_Schnittstelle_(Interaktiv)|REST]]&lt;br /&gt;
*[[HVS32_SOAP_Schnittstelle_(Interaktiv)|SOAP]]&lt;br /&gt;
*[[HVS32_JDBC_Schnittstelle_(Interaktiv)|JDBC]]&lt;br /&gt;
*[[HVS32_SAP_RFC_Schnittstelle_(Interaktiv)|SAP RFC]]&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Wenn das Versandsystem HVS32 öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
*[[Schnittstellen:_Security_Levels_und_Authentifizierung|Schnittstellen: Security Levels und Authentifizierung]]&lt;br /&gt;
&lt;br /&gt;
= Sonstige Schnittstellen =&lt;br /&gt;
*[[Statusdaten_Export_Standard_Schnittstelle|StatusdatenManager (SEM)]]&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_IDOC_Schnittstelle_(Automatik-Polling)&amp;diff=5786</id>
		<title>HVS32 SAP IDOC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_IDOC_Schnittstelle_(Automatik-Polling)&amp;diff=5786"/>
		<updated>2024-05-27T08:34:06Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.6.0.550 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP IDoc Server, (optional für Rückmeldungen via IDoc: SAP IDoc Client)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die Daten werden im IDoc-Format über das auf TCP/IP basierende SAP-RFC-Protokoll (Remote Function Call) vom DGS empfangen. Je HVS32-Funktion muss ein eigener IDoc Type verwendet werden. Die IDoc-Typen können sowohl Basistypen, individualisierte Basistypen als auch komplett individuelle IDocs sein.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Damit vom SAP-System IDocs an den DataGatewayServer gesendet werden können, registriert sich dieser selbständig als externes RFC-Server-Programm (unter einer Programm-ID) bei einem SAP-Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Nach dem Erzeugen des IDoc, wird dieses über einen transaktionsbasierten RFC an den DataGatewayServer gesendet. Dabei wird nicht auf eine Antwort gewartet, das heißt der Aufruf erfolgt asynchron.&amp;lt;br&amp;gt;&lt;br /&gt;
Sobald das IDoc im DGS ankommt, wird anhand der enthaltenen Steuerinformationen eine passende HVS32-Station zur Verarbeitung gesucht. Falls keine Station zur Verfügung steht, wird das IDoc als fehlerhaft protokolliert und verworfen. Im anderen Fall werden die Daten in das spezielle HVS32-XML-Format umgesetzt, das schließlich an die ausgewählte HVS32-Station zur Verarbeitung weitergereicht wird.&lt;br /&gt;
Im HVS32 findet eine sequentielle Verarbeitung aller ankommenden Aufträge statt. Somit kann eine Station nicht mehrere Aufträge parallel verarbeiten. Anschließend werden die Rückmeldedaten an den DGS gegeben, welcher anhand dieser Information das IDoc als erledigt markiert.&amp;lt;br&amp;gt;&lt;br /&gt;
Wie im Ablauf zu sehen ist, wird keine direkte Rückmeldung an SAP geschickt. Der Grund dafür liegt bei der asynchronen Verarbeitung von IDocs, wodurch kein Anfrage-Antwort-Dialog zwischen dem Versandsystem und dem SAP-System zustande kommt. Dennoch besteht grundsätzlich die Möglichkeit die Rückmeldedaten (wie z.B. Paketnummer) über ein separates IDoc nach der Verarbeitung, ebenfalls asynchron, an SAP zu senden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Sapidocablauf.jpg|Ablauf: DGS SAP/IDoc Server&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in 64Bit&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ (64bit) voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
**alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
**Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Server / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| IDocTypes || Liste von IDoc-Typen, die vom DataGatewayServer interpretiert werden sollen&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im IDoc als Untersegment des Packstück-Segments definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Die Kommunikation ist unidirektional, d.h. eine Rückmeldung aus dem HVS32 erfolgt nicht bzw. asynchron in einer eigenen Trasaktion&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
* DELVRY05, DELVRY07&lt;br /&gt;
* DESADV01&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=5785</id>
		<title>HVS32 SAP RFC Schnittstelle (Automatik-Polling)</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=HVS32_SAP_RFC_Schnittstelle_(Automatik-Polling)&amp;diff=5785"/>
		<updated>2024-05-27T08:33:13Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:HVS32_SAP_RFC_Interface_(Polling)]]&lt;br /&gt;
&lt;br /&gt;
= Voraussetzungen =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Version || 3.6.0.550 oder höher&lt;br /&gt;
|-&lt;br /&gt;
| DGS-Plugins || HVS32Client, SAP RFC Server&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Funktionsbeschreibung =&lt;br /&gt;
Der DataGatewayServer (DGS) nutzt für die Kommunikation mit einem SAP System die SAP Bibliothek &amp;quot;JCo&amp;quot; und agiert beim Automatik Polling als JCo Server-Programm.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS ist die zentrale Kommunikationseinheit, über die sämtliche Daten zwischen dem Versandsystem und dem SAP-System ausgetauscht werden. Er läuft in Form eines Dienstes auf einem Windows-Server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Es können beliebige RFC Funktionen im DGS implementiert werden, welche von einem RFC-Client (SAP) aus aufgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Je HVS32 Funktion muss ein separater RFC Baustein genutzt werden. Die Struktur des RFC-Bausteins (Felder, Tabellen, Strukturen) ohne Implementierung muss im SAP System auf einem Applikationsserver für den DGS verfügbar sein - da die Metadaten der RFC Bausteine bei Systemstart abgerufen werden. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der DGS registriert sich selbst unter einer Programm-ID an einem SAP Gateway (nicht für ein spezifisches SAP-System) und wartet auf eingehende RFC-Aufrufe.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn ein RFC-Aufruf von einem beliebigen SAP-System an dieses SAP Gateway mit der Option &amp;quot;Verbindung mit einem bereits registrierten Programm&amp;quot; (mit der selben Programm-ID) übermittelt wird, findet die Verbindung mit dem DGS statt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Ausführen einer RFC-Funktion wartet der DGS auf weitere RFC-Aufrufe vom selben oder einem anderen SAP-System.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Im Falle einer unterbrochenen oder beendeten RFC-Verbindung registriert sich der DGS automatisch wieder am selben SAP Gateway unter der selben Programm-ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
RFCServerCentralSAPGateway.png|DGS SAP/RFC Server an zentralem SAP Gateway&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notwendige SAP-Komponenten/-Parameter =&lt;br /&gt;
* neueste Version 3 der SAP Bibliothek Java Connector &amp;quot;JCo&amp;quot; in &amp;#039;&amp;#039;&amp;#039;64Bit&amp;#039;&amp;#039;&amp;#039; (sapjco3.jar + sapjco3.dll)&lt;br /&gt;
** Die Verwendung vom SAP JCo 3.1 setzt die Installation vom Microsoft Visual Studio 2013 C/C++ &amp;#039;&amp;#039;&amp;#039;64bit&amp;#039;&amp;#039;&amp;#039; voraus.&lt;br /&gt;
* SAP GUI Installation auf dem HVS32 Server, auf welchem die Heidler Applikationen installiert sind&lt;br /&gt;
** alternativ eine manuelle Anpassung der %SystemRoot%\system32\drivers\etc\services und %SystemRoot%\system32\drivers\etc\hosts&lt;br /&gt;
** Die SAP GUI installiert unter anderem auch die Microsoft Visual Studio komponenente (nach Installation prüfen, ob für die korrekte Version für die eingesetzte SAP JCo vorhanden ist)&lt;br /&gt;
* eine definierte Destination mit Verbindungstyp T (TCP/IP-Verbindung) im SAP-System über die Transaktion SM59 ([[#Destination_.C3.BCber_SM59_definieren|siehe Destination über SM59 definieren]])&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
folgende Parameter werden vom DGS benötigt, um sich mit einer Programm-ID an einem SAP Gateway zu registrieren:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwhost || SAP-Gateway (Servername / IP) an welchem die Funktionsbausteine registriert werden&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.gwserv || SAP-Gateway-Service (Port) der genutzt wird (z.B. sapgw00)&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.progid || Programm-ID aus der SM59 unter welcher die Registrierung stattfindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.server.connection_count || Anzahl gleichzeitiger Verbindungen, die später von SAP zum Aufruf genutzt werden können		&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.ashost || SAP-Applikation-Server (Servername / IP) auf welchem sich die Struktur des RFC Bausteins befindet&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.sysnr || SAP System Nr (Zweistellig nummerisch)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.client || Mandanten ID (SAP)&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.user || SAP-Benutzer mit Rechten zum Ausführen von RFC&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.passwd || Passwort&lt;br /&gt;
|-&lt;br /&gt;
| rfcfunctions || Liste aller RFC-Funktionsbausteinen, welche im SAP bereitgestellt werden&lt;br /&gt;
|}&lt;br /&gt;
Falls für clientseitige RFC-Aufrufe eine Lastverteilung (SAP Message Server) auf Seiten von SAP genutzt wird, muss anstelle der Parameter ashost und sysnr folgendes konfiguriert werden:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter !! Beschreibung&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.mshost || IP oder Name des SAP Message Server&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.r3name || System ID des SAP-Systems&lt;br /&gt;
|-&lt;br /&gt;
| jco.client.group || Name der SAP-Servergruppe&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Verfügbare HVS32 Funktionen =&lt;br /&gt;
Artikel-Daten und Gefahrgut-Informationen müssen im RFC Baustein als Table oder Struct definiert werden, da diese in einer 1:n Beziehung zu den Packstückdaten stehen.&amp;lt;br&amp;gt;&lt;br /&gt;
Alle Parameter, welche an das HVS32 gesendet werden sollen, müssen in die Import-Parameter geschrieben werden. Die Rückmeldung aus dem HVS32 erfolgt in den Export-Parametern. Die Kommunikation ist bidirektional, d.h. die Rückmeldung erfolgt synchron in der gleichen Transaktion wie die Anfrage.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitte beachten Sie, dass die Feld-Beschreibungen sich nur auf einen Standard beziehen, welcher als Vorschlag für die Schnittstelle dienen soll. Funktionsnamen, Feldnamen /-längen /-formate können prinzipiell abweichen, müssen in diesem Fall jedoch individuell betrachtet/analysiert werden.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[HVS32_Automatik-Polling_Funktionen|Verfügbare HVS32 Funktionen]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Beispiele =&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:60%; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für eine RFC Baustein Struktur für die VersandDatenAnfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
&amp;#039;ZHVSVERSANDDATENANFRAGE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
IMPORTING&lt;br /&gt;
  PACKSTUECK STRUCTURE&lt;br /&gt;
    KUNDENNR CHAR(20)&lt;br /&gt;
    ZIELADRNAME1 CHAR(50)&lt;br /&gt;
    ZIELADRNAME2 CHAR(50)&lt;br /&gt;
    ZIELADRNAME3 CHAR(50)&lt;br /&gt;
    ZIELADRSTRASSE CHAR(50)&lt;br /&gt;
    ZIELADRLKZ CHAR(5)&lt;br /&gt;
    ZIELADRPLZ CHAR(10)&lt;br /&gt;
    ZIELADRORT CHAR(50)&lt;br /&gt;
    ZIELADRREGION CHAR(20)&lt;br /&gt;
    ZIELADRBAHNHOF CHAR(30)&lt;br /&gt;
    ANSPRECHPARTNER CHAR(20)&lt;br /&gt;
    TELEFONNR CHAR(20)&lt;br /&gt;
    FAXNR CHAR(20)&lt;br /&gt;
    USTIDNR CHAR(20)&lt;br /&gt;
    ILNNR CHAR(20)&lt;br /&gt;
    AUFTRAGGEBERID CHAR(10)&lt;br /&gt;
    VERSANDARTID CHAR(10)&lt;br /&gt;
    AVISHINWEIS1 CHAR(30)&lt;br /&gt;
    AVISHINWEIS2 CHAR(30)&lt;br /&gt;
    AVISZUSATZ1 CHAR(20)&lt;br /&gt;
    AVISZUSATZ2 CHAR(20)&lt;br /&gt;
    LIEFERSCHEINNR CHAR(40)&lt;br /&gt;
    AUFTRAGNR CHAR(20)&lt;br /&gt;
    BESTELLNR CHAR(20)&lt;br /&gt;
    WARENWERT CHAR(19)&lt;br /&gt;
    WWWAEHRUNG CHAR(3)&lt;br /&gt;
    NACHNAHME CHAR(19)&lt;br /&gt;
    NNWAEHRUNG CHAR(3)&lt;br /&gt;
    NNVERMERK CHAR(1)&lt;br /&gt;
    NNVERWENDUNG CHAR(30)&lt;br /&gt;
    VERSICHERUNGSWERT CHAR(19)&lt;br /&gt;
    VWWAEHRUNG CHAR(3)&lt;br /&gt;
    FRANKATURKENNUNG CHAR(10)&lt;br /&gt;
    ZAHLUNGSBEDIGNUNG CHAR(10)&lt;br /&gt;
    ZBZOLL CHAR(1)&lt;br /&gt;
    FRACHTFUEHRERKDNR CHAR(10)&lt;br /&gt;
    SONDERDIENSTE CHAR(30)&lt;br /&gt;
    SENDUNGSINHALT CHAR(30)&lt;br /&gt;
    TERMINART CHAR(1)&lt;br /&gt;
    TERMINDATUM CHAR(10)&lt;br /&gt;
    TERMINZEIT CHAR(5)&lt;br /&gt;
    NEUTABSENDERNAME1 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME2 CHAR(30)&lt;br /&gt;
    NEUTABSENDERNAME3 CHAR(30)&lt;br /&gt;
    NEUTABSENDERSTRASSE CHAR(30)&lt;br /&gt;
    NEUTABSENDERLKZ CHAR(3)&lt;br /&gt;
    NEUTABSENDERPLZ CHAR(10)&lt;br /&gt;
    NEUTABSENDERORT CHAR(30)&lt;br /&gt;
    RECHNUNGSEMPFNAME1 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME2 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFNAME3 CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFSTRASSE CHAR(50)&lt;br /&gt;
    RECHNUNGSEMPFLKZ CHAR(5)&lt;br /&gt;
    RECHNUNGSEMPFPLZ CHAR(10)&lt;br /&gt;
    RECHNUNGSEMPFORT CHAR(50)&lt;br /&gt;
    POSTLEITCODE CHAR(15)&lt;br /&gt;
    POSTZIELFRACHTZENT CHAR(5)&lt;br /&gt;
    FRACHTBRIEF CHAR(20)&lt;br /&gt;
    GEWICHT CHAR(9)&lt;br /&gt;
    NETTOGEWICHT CHAR(9)&lt;br /&gt;
    PACKSTKGES CHAR(10)&lt;br /&gt;
    PACKSTKNR CHAR(10)&lt;br /&gt;
    VERPACKUNGSART CHAR(6)&lt;br /&gt;
    PACKSTUECKLAENGE CHAR(10)&lt;br /&gt;
    PACKSTUECKBREITE CHAR(10)&lt;br /&gt;
    PACKSTUECKHOEHE CHAR(10)&lt;br /&gt;
    PACKPLATZ CHAR(10)&lt;br /&gt;
    PACKSTUECKID CHAR(15)&lt;br /&gt;
    ANZAHLARTIKEL CHAR(10)&lt;br /&gt;
    ZUSATZZEILE1 CHAR(150)&lt;br /&gt;
    ZUSATZZEILE2 CHAR(150)&lt;br /&gt;
    FREIAVIS1 CHAR(62)&lt;br /&gt;
    FREIAVIS2 CHAR(62)&lt;br /&gt;
    HVELEKTRONIKARTIKEL CHAR(1)&lt;br /&gt;
    EMPFEMAILADRESSE CHAR(100)&lt;br /&gt;
    KOSTENSTELLE CHAR(30)&lt;br /&gt;
    DRUCKERNAME CHAR(30)&lt;br /&gt;
  DGPOSITIONS STRUCTURE&lt;br /&gt;
    GEFAHRGUTUNNR CHAR(4)&lt;br /&gt;
    GEFAHRGUTKLASSE CHAR(6)&lt;br /&gt;
    GEFAHRGUTVPG CHAR(5)&lt;br /&gt;
    GEFAHRGUTKCODE CHAR(5)&lt;br /&gt;
    GEFAHRGUTBEZEICHNUNG CHAR(110)&lt;br /&gt;
    GEFAHRGUTMENGE CHAR(9)&lt;br /&gt;
    GEFAHRGUTBEGRENZTEMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTVERPANZAHL CHAR(10)&lt;br /&gt;
    GEFAHRGUTVERPACKUNGSART CHAR(8)&lt;br /&gt;
    GEFAHRGUTNEBENGEFAHR CHAR(20)&lt;br /&gt;
    GEFAHRGUTBUCHST640 CHAR(1)&lt;br /&gt;
    GEFAHRGUTMENGENEINHEIT CHAR(2)&lt;br /&gt;
    GEFAHRGUTBEFOERDKAT CHAR(10)&lt;br /&gt;
    GEFAHRGUTFAKTOR CHAR(10)&lt;br /&gt;
    GEFAHRGUTNETTOEXPLMASSE CHAR(9)&lt;br /&gt;
    GEFAHRGUTTUNNELBCODE CHAR(10)&lt;br /&gt;
    GEFAHRGUTFREIGESTMENGE CHAR(1)&lt;br /&gt;
    GEFAHRGUTFFCODE CHAR(20)&lt;br /&gt;
  DELIVERYPOSITIONS STRUCTURE&lt;br /&gt;
    ANZAHLPOSETIKETTEN CHAR()&lt;br /&gt;
    ARTIKELBTNNR CHAR(25)&lt;br /&gt;
    ARTIKELEAN CHAR(20)&lt;br /&gt;
    ARTIKELEINHEIT CHAR(10)&lt;br /&gt;
    ARTIKELGEWICHT CHAR(9)&lt;br /&gt;
    ARTIKELMENGE CHAR(9)&lt;br /&gt;
    ARTIKELSOLLMENGE CHAR(9)&lt;br /&gt;
    ARTIKELTEXT1 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT2 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT3 CHAR(100)&lt;br /&gt;
    ARTIKELTEXT4 CHAR(100)&lt;br /&gt;
    ARTIKELWAEHRUNG CHAR(3)&lt;br /&gt;
    ARTIKELWERT CHAR(9)&lt;br /&gt;
    CHARGEFLAG CHAR(1)&lt;br /&gt;
    KUNDENARTIKELNR CHAR(50)&lt;br /&gt;
    KUNDENBESTELLNR CHAR(50)&lt;br /&gt;
    POSAUFTRAGNR CHAR(50)&lt;br /&gt;
    POSITIONNR CHAR(40)&lt;br /&gt;
    POSLIEFERNR CHAR(40)&lt;br /&gt;
    SERIENNR CHAR(30)&lt;br /&gt;
    URSPRUNGLAND CHAR(2)&lt;br /&gt;
    ARTIKELGRUPPE CHAR(50)&lt;br /&gt;
    ARTIKELSERVICES CHAR(100)&lt;br /&gt;
    ARTIKELVOLUMEN CHAR(9)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EXPORTING&lt;br /&gt;
  PACKSTUECKRUECK STRUCTURE&lt;br /&gt;
    TRACKINGNR CHAR(35)&lt;br /&gt;
    VERSANDSENDUNGSNR CHAR(20)&lt;br /&gt;
    DRUCKDATETIME CHAR(10)&lt;br /&gt;
    AUSGANGDATETIME CHAR(10)&lt;br /&gt;
    GEBUEHR CHAR(19)&lt;br /&gt;
    GEBUEHRWAEHRUNG CHAR(3)&lt;br /&gt;
    FEHLERTEXT1 CHAR(200)&lt;br /&gt;
    FEHLERTEXT2 CHAR(200)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ / Troubleshooting =&lt;br /&gt;
=== Destination über SM59 definieren ===&lt;br /&gt;
Zur Einrichtung einer RFC-Verbindung im SAP, welche für die Anbindung des HVS32 Versandsystems gedacht ist, gehen Sie bitte wie folgt vor:&lt;br /&gt;
# Wechseln Sie zur Transaktion sm59&lt;br /&gt;
# Wählen Sie den Typ T (TCP/IP connections) &amp;#039;&amp;#039;&amp;#039;[Abb.1]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Erstellen Sie mit dem Button &amp;quot;create&amp;quot; eine neue Verbindung&lt;br /&gt;
# Geben Sie eine RFC Destination an (z.B. &amp;quot;RFC_HVS32&amp;quot;)&lt;br /&gt;
# Stellen Sie den Aktivierungstyp auf &amp;quot;Registriertes Serverprogramm&amp;quot;&lt;br /&gt;
# Legen Sie eine Programm ID fest (z.B. &amp;quot;HVS32&amp;quot;) &amp;#039;&amp;#039;&amp;#039;[Abb.2]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Öffnen Sie den Reiter &amp;quot;MDMP &amp;amp; Unicode&amp;quot;&lt;br /&gt;
# Stellen Sie dort die Art der Kommunikation auf &amp;quot;Unicode&amp;quot; &amp;#039;&amp;#039;&amp;#039;[Abb.3]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Speichern Sie die Einstellungen&lt;br /&gt;
# Sie können die Verbindung über &amp;quot;Connection Test&amp;quot; prüfen, sobald auf dem Zielsystem der DataGatewayServer installiert und als Dienst gestartet ist &amp;#039;&amp;#039;&amp;#039;[Abb.4]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
sm59_1.png|Abb.1&lt;br /&gt;
sm59_2.png|Abb.2&lt;br /&gt;
sm59_3.png|Abb.3&lt;br /&gt;
sm59_4.png|Abb.4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=5704</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=5704"/>
		<updated>2024-04-08T07:03:28Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Interfaces:_Security_Levels_and_Authentication]]&lt;br /&gt;
&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&amp;lt;br&amp;gt;Es wird &amp;#039;&amp;#039;&amp;#039;mindestens&amp;#039;&amp;#039;&amp;#039; die DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.31&amp;#039;&amp;#039;&amp;#039; benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
Diese Authentifizierungs-Methode ist ausschließlich über das Authentifzierungssystem [[IRIS_Cloudsystem|IRIS Cloudsystem]] möglich.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5703</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5703"/>
		<updated>2024-04-08T07:02:37Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
&lt;br /&gt;
The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
&amp;lt;br&amp;gt;DataGatewayServer Version &amp;#039;&amp;#039;&amp;#039;3.8.31&amp;#039;&amp;#039;&amp;#039; or higher is needed.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=5702</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=5702"/>
		<updated>2024-04-08T07:01:18Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Interfaces:_Security_Levels_and_Authentication]]&lt;br /&gt;
&lt;br /&gt;
Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
&lt;br /&gt;
Es wird mindestens die DataGatewayServer Version 3.8.31 benötigt.&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
Diese Authentifizierungs-Methode ist ausschließlich über das Authentifzierungssystem [[IRIS_Cloudsystem|IRIS Cloudsystem]] möglich.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5682</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5682"/>
		<updated>2024-03-21T12:08:06Z</updated>

		<summary type="html">&lt;p&gt;Odelice: /* Authorization Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; This article is a work in progress. The security features described for the DataGatewayServer are on our development roadmap for the end of Q1/2024 and therefore not yet implemented.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_cloud_system|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=5681</id>
		<title>Schnittstellen: Security Levels und Authentifizierung</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Schnittstellen:_Security_Levels_und_Authentifizierung&amp;diff=5681"/>
		<updated>2024-03-21T12:07:17Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[en:Interfaces:_Security_Levels_and_Authentication]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Dieser Artikel ist &amp;quot;work in progress&amp;quot;, die beschriebenen Sicherheitsfeatures für das DataGatewayServer sind auf unserer Entwicklungs-roadmap für Ende Q1/2024 und demnach noch nicht umgesetzt.&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Grundsätzlich kann das HVS32 ohne Bedenken in Cloud-Umgebungen betrieben werden, sofern die Verbindung vom Vorsystem (ERP bzw. WMS, nachfolgend der Einfachheit halber nur ERP genannt) zum HVS32 in einem gemeinsamen, gesicherten, internen Netzwerk ist.&amp;lt;br&amp;gt;Wenn das Versandsystem HVS32 allerdings öffentlich erreichbar sein muss - also sich das Vorsystem (ERP/WMS) und das Versandsystem HVS32 nicht im gleichen Netzwerk (LAN, vLAN, vNET, private cloud) befinden - muss die Kommunikations-Verbindung der beiden Systeme abgesichert werden.&amp;lt;br&amp;gt;Dies impliziert, dass sowohl die Verbindung verschlüsselt als auch jede eingehende Verbindung authentifiziert werden muss.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastruktur)=&lt;br /&gt;
Zur Absicherung der Netzwerk-Brücke gibt es keine zu 100% perfekte oder sichere Lösung. Meist muss man sich für einen Kompromiss je nach Fall entscheiden. In der Infrastruktur können jedoch bereits diverse Security Levels implementiert werden, um die Sicherheit maßgeblich zu erhöhen.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
Befinden sich die beiden Server in einem gemeinsamen Netzwerk, bzw. liegt eine gesicherte Netzwerk-Brücke via VPN zu Grunde, bietet dies grundlegend die beste Basis für eine sichere Datenkommunikation zwischen dem Vorsystem und dem Versandsystem HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Level (Infrastruktur) - LAN / vLAN / vNET / private cloud / VPN]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
Bei einer ungesicherten Netzwerk-Brücke ist unbedingt darauf zu achten, dass die Kommunikation ausschließlich verschlüsselt und authentifiziert stattfindet.&lt;br /&gt;
[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Level (Infrastruktur) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Da alle Verbindungen zum DGS (DataGatewayServer - Kommunikations-/Schnittstellen-Software) eingehend sind, kann als zusätzliche Sicherheitsmaßnahme der DGS auf einem separaten Server installiert werden, bei welchem alle ausgehenden Verbindungen via Firewall blockiert werden.&lt;br /&gt;
[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Level (Infrastruktur) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentifizierung=&lt;br /&gt;
Authentifizierungs-Mechanismen können nur als &amp;quot;sicher&amp;quot; bezeichnet werden, wenn diese in Kombination mit anderen Sicherheits-Mechanismen wie HTTPS/SSL genutzt werden. Die Verschlüsselung ist mittels HTTPS unter Verwendung von TLSv1.2 oder TLSv1.3 (sofern vom Client unterstützt) möglich.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die folgenden Authentifizierungs-Optionen beziehen sich &amp;#039;&amp;#039;&amp;#039;ausschließlich&amp;#039;&amp;#039;&amp;#039; auf die [https://interface.heidler-strichcode.de?version=v2 RESTv2 Schnittstelle]&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
Die Basisauthentifizierung ist ein einfaches Authentifizierungsschema, welches in das HTTP-Protokoll integriert ist. Der Client sendet in jeder HTTP-Anfrage den Authentifizierungsheader, welcher Benutzername und Passwort enthält.&lt;br /&gt;
&lt;br /&gt;
Der Authentifizierungsheader lautet &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; und beinhaltet den Benutzer und das Passwort Base64 codiert im Format &amp;#039;&amp;#039;- Basic &amp;lt;Benutzer&amp;gt;:&amp;lt;Passwort&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der Benutzer &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; mit dem Passwort &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung aufgrund von ungültigen Benutzerdaten fehlschlagen, so wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Unauthorized acces&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
HTTP Digest Access Authentication ist ein Authentifizierungsmechanismus, der in das HTTP-Protokoll integriert ist und dazu dient, die Sicherheit von Webanwendungen zu erhöhen. Im Gegensatz zur einfachen Basisauthentifizierung überträgt Digest Access Authentication keine Benutzernamen und Passwörter im Klartext, sondern verwendet kryptografisch sichere Methoden.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bei der Digest-Authentifizierung sendet der Client eine Anfrage an den Server (ohne Authentifizierung im Header), der daraufhin eine &amp;quot;Nonce&amp;quot; (eine einmalige Zufallszahl) zurückgibt. Alternativ kann diese über den Enpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039; abgerufen werden. Der Client kombiniert diese Nonce mit Benutzername, Passwort, Anfrage-Methode und URI und erstellt einen &amp;quot;Digest&amp;quot; (Prüfzusammenstellung). Dieser Digest wird dann an den Server gesendet.&amp;lt;br&amp;gt;Der Server kann den Digest überprüfen, indem er denselben Algorithmus auf der Serverseite anwendet und die berechneten Werte vergleicht. Da der Digest mit Hilfe der Nonce und kryptografisch sicheren Techniken erstellt wird, schützt die Digest-Authentifizierung effektiv vor Angriffen wie Passwortdiebstahl und Mann-in-the-Middle-Angriffen (MitM).&lt;br /&gt;
&lt;br /&gt;
Für die Erstellung vom Digest wird aktuell nur der Algorithmus MD5 unterstützt. Weitere Algorithmusverfahren können nach Rücksprache implementiert werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Benutzerverwaltung erfolgt im DataGatewayServer. Dort können neue Benutzer angelegt und gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Benutzern steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage einer nonce für die Erstellung des Digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der initialen Anfrage wird im Header keine Authentifizierung geliefert, da vom Server zuerst die nonce abgefragt werden muss. In der Rückmeldung vom DataGatewayServer befindet sich dann die &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039; zusammen mit weiteren Informationen, welche für die Erstellung eines Digest benötigt werden, im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diese Anfrage wird mit dem HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; und der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;Authentication required!&amp;quot;&amp;#039;&amp;#039; im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Anfrage nach erhaltener nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Nachdem der Client die &amp;#039;&amp;#039;&amp;#039;nonce, realm, qop und die opaque&amp;#039;&amp;#039;&amp;#039; aus der initialen Anfrage extrahiert und damit den Digest generiert hat, kann dieser für die Authentifizierung über den HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Das Format entspricht dabei:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;BENUTZERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Der Parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; und &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; wird jeweils vom Client generiert und muss für die Erstellung vom Digest genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;BENUTZER&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einer ungültigen Authentifizierung (Verwendung vom HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;) wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;client credentials invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
Die API-Key-Authentifizierung ist eine einfache Methode zur Sicherung von API-Zugriffen. Bei dieser Authentifizierungsmethode erhält der Benutzer / Client einmalig einen eindeutigen API-Schlüssel (API-Key). Dieser Schlüssel muss dann bei jeder API-Anfrage im Header mit gesendet werden.&amp;lt;br&amp;gt;Der Server überprüft den empfangenen API-Key, um sicherzustellen, dass die Anfrage von einem authentifizierten Benutzer oder Anwendung stammt.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Der API-Key muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, diesen regelmäßig zu zu aktualisieren, um die Sicherheit zu gewährleisten.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der API-Key wird im DataGatewayServer verwaltet. Dort kann ein neuer Key generiert oder bestehende gelöscht werden. Es können mehrere gültige API-Keys existieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen API-Keys steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für eine Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In diesem Beispiel wird der API-Key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Aus demonstrationszwecken wird in dem Beispiel ein einfacher API-Key verwendet. Der DataGatewayServer erzeugt einen entsprechend langen und komplexen Key.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei einem falschen API-Key wird der HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; mit der Fehlermeldung &amp;#039;&amp;#039;&amp;quot;api key invalid!&amp;quot;&amp;#039;&amp;#039; im Body zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
OAuth 2.0 Client Credentials ist eine Authentifizierungs-Methode im OAuth 2.0-Protokoll, die es einer Anwendung ermöglicht, sich beim Authorization Server (Authentifizierungsserver) zu authentifizieren. Dies ist besonders nützlich für den Zugriff von Anwendungen auf APIs ohne Benutzerbeteiligung und eignet sich gut für server-seitige Kommunikation zwischen Diensten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Das ERP wird am Server registriert und erhält eine eindeutige Client-ID und ein Client-Secret.&amp;lt;br&amp;gt;Inital wird dann von dem ERP eine HTTP-POST-Anfrage an den Authorization Server gesendet, welche die Client-Anmeldeinformationen (Client-ID und Client-Secret) beinhaltet. Im Response wird ein Access-Token und ein Refresh-Token zurück gemeldet.&amp;lt;br&amp;gt;Das ERP sendet nun für die Authentifizierung bei jeder Anfrage das Access-Token im Authorization Header der HTTP-Anfragen mit. Wenn das Access-Token abgelaufen ist, kann mit dem Refresh-Token ein neuer Access-Token angefragt werden. Im Falle einer mehrfachen Nutzung eines Refresh-Tokens werden automatisch alle Refresh-Tokens und Access-Tokens gesperrt.&amp;lt;br&amp;gt;Das Client-Secret muss sicher aufbewahrt werden, um unbefugten Zugriff zu verhindern. Außerdem ist es wichtig, das Client Secret regelmäßig zu zu aktualisieren, um die Sicherheit weiter zu erhöhen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Die Client-ID und Client-Secret werden im DataGatewayServer verwaltet. Dort können neue Zugangsdaten angelegt oder bestehende gelöscht werden.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Mit zunehmender Anzahl von gültigen Client-IDs steigt auch die Wahrscheinlichkeit, dass sich durch eine &amp;quot;Brute-Force-Attacke&amp;quot; unerlaubter Zugriff gewährt wird.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispiel für die Token-Anfrage (Access- und Refreshtoken mit Client-ID + Client-Secret generieren)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Bei der Token-Anfrage muss die Client-ID und das Client-Secret im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; Base64 codiert im Format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039; übermittelt werden. Zusätzlich ist für diese Funktion der &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; notwendig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Token-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Token-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken in Sekunden (expires_in) zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken hat aus Sicherheitsgründen eine begrenzte Gültigkeit. Nach Ablauf ist der Accesstoken nicht mehr verwendbar und man erhält einen HTTP-Code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039;. In diesem Fall muss über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken generiert werden (empfohlen) oder über die Token-Anfrage und der Client-ID + Client-Secret ein neues Accesstoken angefragt werden (nicht empfohlen).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Die regelmäßige Generierung von Accesstoken über die Token-Anfrage wird nicht empfohlen, da hier die Client-ID + Client-Secret übertragen wird. Dadurch ist die Anfälligkeit gegen MitM-Angriffen höher. Das Client-Secret sollte so selten wie möglich eingesetzt werden. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Nutzung eines Accesstokens&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Der aus der Token-Anfrage erhaltene Accesstoken kann nun im HTTP-Header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; an den DataGatewayServer übermittelt werden, um sich zu authentifizieren. Dieser muss im Format - &amp;#039;&amp;#039;Bearer &amp;lt;Accesstoken&amp;gt;&amp;#039;&amp;#039; übertragen werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Beispielheader für die Refresh-Anfrage (Access- und Refreshtoken mit gültigem Refreshtoken erneuern)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Falls ein Accesstoken abgelaufen ist und dieser erneut werden muss, kann über die Refresh-Anfrage und einem gültigen Refreshtoken ein neuer Accesstoken + Refreshtoken generiert werden. In dieser Anfrage muss der HTTP-Header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; mit dem Refreshtoken und der Header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; mit dem Wert &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039; übermittelt werden.&lt;br /&gt;
&lt;br /&gt;
Um die Sicherheit vor MitM-Angriffen zu erhöhen, empfiehlt es sich den Accesstoken regelmäßig und im kurzen intervall zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hinweis:&amp;#039;&amp;#039;&amp;#039; Ein Refreshtoken kann nur einmalig für die Refreshanfrage genutzt werden. Anschließend verliert der Token seine Gültigkeit. Falls ein ungültiger Refreshtoken für die Authentifizierung beim DataGatewayServer genutzt wird, werden aus Sicherheitsgründen alle gültigen Access- und Refreshtoken deaktiviert. Die Authentifizierung muss in diesem Fall wieder über die Token-Anfrage stattfinden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung der Refresh-Anfrage&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In der Rückmeldung der Refresh-Anfrage wird im Body der Accesstoken (access_token), der Refreshtoken (refresh_token), der Tokentyp (token_type) und Gültigkeit vom Accesstoken (expires_in) in Sekunden zurück gemeldet.&lt;br /&gt;
&lt;br /&gt;
Der Accesstoken kann nun für die Authentifizierung in den restlichen Anfragen genutzt werden.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Rückmeldung bei fehlgeschlagener Authentifizierung - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Sollte die Authentifizierung fehlschlagen, so wird der HTTP-Code 401 Unauthorized mit einer entsprechenden Fehlermeldung im Body quittiert.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;FEHLERMELDUNG&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
Diese Authentifizierungs-Methode ist ausschließlich über das Authentifzierungssystem [[IRIS_Cloudsystem|IRIS Cloudsystem]] möglich.&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5680</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5680"/>
		<updated>2024-03-21T12:06:37Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[de:Schnittstellen:_Security_Levels_und_Authentifizierung]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; This article is a work in progress. The security features described for the DataGatewayServer are on our development roadmap for the end of Q1/2024 and therefore not yet implemented.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_Cloudsystem|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5679</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5679"/>
		<updated>2024-03-21T12:05:56Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; This article is a work in progress. The security features described for the DataGatewayServer are on our development roadmap for the end of Q1/2024 and therefore not yet implemented.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be requested by using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token is disabled. For security reasons, if an invalid refresh token is used for authentication with the DataGatewayServer all access and refresh tokens, which were created prior to that, will be disabled. Authentication via token request is required afterwards.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_Cloudsystem|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5678</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5678"/>
		<updated>2024-03-21T09:12:42Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; This article is a work in progress. The security features described for the DataGatewayServer are on our development roadmap for the end of Q1/2024 and therefore not yet implemented.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and expiration of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a expiration time. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Using the token request regularly to generate an access tokens is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be generated using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token expires. If an invalid refresh token is used for authentication with the DataGatewayServer, for security reasons, all valid access and refresh tokens will be deactivated. Authentication must then be done again through the token request.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_Cloudsystem|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
	<entry>
		<id>https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5677</id>
		<title>Interfaces: Security Levels and Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.heidler-strichcode.de/w/index.php?title=Interfaces:_Security_Levels_and_Authentication&amp;diff=5677"/>
		<updated>2024-03-21T07:25:57Z</updated>

		<summary type="html">&lt;p&gt;Odelice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; This article is a work in progress. The security features described for the DataGatewayServer are on our development roadmap for the end of Q1/2024 and therefore not yet implemented.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The HVS32 can be operated in cloud environments without concerns, assuming that the connection from the host system (ERP or WMS, hereinafter referred to as ERP for simplicity) to HVS32 is within a shared, secure, internal network.&amp;lt;br&amp;gt;However, if the shipping software HVS32 needs to be publicly accessible — meaning that the host system (ERP/WMS) and the shipping software HVS32 are not located in the same network (LAN, vLAN, vNET, private cloud) — the communication between the two systems must be secured.&amp;lt;br&amp;gt;This implies that both the connection must be encrypted, and each incoming connection must be authenticated and authorized.&lt;br /&gt;
&lt;br /&gt;
=Security Levels (Infrastructure)=&lt;br /&gt;
To secure the network bridge, there is no 100% perfect or foolproof solution. Typically, one has to opt for a compromise depending on the specific case. However, in the infrastructure, various security levels can already be implemented to significantly enhance security.&lt;br /&gt;
==LAN / vLAN / vNET / private cloud / VPN==&lt;br /&gt;
If the two servers are within the same network or there is a secured network bridge via VPN in place, this provides the best foundation for secure data communication between the host system and the shipping software HVS32.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure vpn.png|1000px|rahmenlos|Security Levels (Infrastructure) - LAN / vLAN / vNET / private cloud / VPN]]&lt;br /&gt;
&lt;br /&gt;
==S2S (Server-to-Server)==&lt;br /&gt;
In the case of an unsecured network bridge, it is crucial to ensure that communication takes place exclusively through encryption and authentication.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure s2s.png|1000px|rahmenlos|Security Levels (Infrastructure) - S2S (Server-to-Server)]]&lt;br /&gt;
==Dead-End-Server==&lt;br /&gt;
Since all connections to the DGS (DataGatewayServer - Communication-/Interface-Software) are incoming, as an additional security measure, the DGS can be installed on a separate server where all outgoing connections are blocked via firewall.&amp;lt;br&amp;gt;[[Datei:Securitylevel infrastructure des.png|1000px|rahmenlos|Security Levels (Infrastructure) - Dead-End-Server]]&lt;br /&gt;
&lt;br /&gt;
=Authentication=&lt;br /&gt;
Authentication mechanisms can only be considered &amp;quot;secure&amp;quot; when used in combination with other security mechanisms such as HTTPS/SSL. Encryption is achieved through HTTPS using TLSv1.2 or TLSv1.3 (if supported by the client).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The following authentication options are specific to the [https://interface.heidler-strichcode.de?version=v2 RESTv2 interface].&lt;br /&gt;
==Basic Authentication==&lt;br /&gt;
The Basic authentication is a simple authentication scheme integrated into the HTTP protocol. The client sends the authentication header in every HTTP request, which contains the username and password.&lt;br /&gt;
&lt;br /&gt;
The authentication header is named &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; and includes the username and password base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;Username&amp;gt;:&amp;lt;Password&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example user &amp;#039;&amp;#039;heidler&amp;#039;&amp;#039; and password &amp;#039;&amp;#039;Wolfschlugen&amp;#039;&amp;#039; is used.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic aGVpZGxlcjpXb2xmc2NobHVnZW4=&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails due to invalid user data, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned with the error message &amp;#039;&amp;#039;Unauthorized access&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Basic realm=&amp;quot;Restricted Area&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:00:44 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 19&lt;br /&gt;
 &lt;br /&gt;
Unauthorized access&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Digest Access Authentication==&lt;br /&gt;
The Digest Access Authentication is an authentication mechanism using the HTTP protocol designed to enhance the security of web applications. Unlike basic authentication, which transmits usernames and passwords in plaintext, Digest Access Authentication uses cryptographically secure methods.&lt;br /&gt;
&lt;br /&gt;
In Digest authentication, the client sends a request to the server (without authentication in the header), which then returns a &amp;quot;nonce&amp;quot; (a unique random number). Alternatively, this nonce can be obtained via the endpoint &amp;#039;&amp;#039;v2/hsc/auth/digest&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The client combines this nonce with the username, password, request method, and URI to create a &amp;quot;digest&amp;quot; (checksum). This digest is then sent to the server. The server can verify the digest by applying the same algorithm on the server side and comparing the calculated values. Because the digest is created using the nonce and cryptographically secure techniques, Digest Authentication effectively protects against attacks such as password theft and man-in-the-middle (MitM) attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, only the MD5 algorithm is supported for digest creation. Additional algorithm procedures can be implemented upon consultation.&lt;br /&gt;
&lt;br /&gt;
User management is handled within the DataGatewayServer. New users can be created and deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid users increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request for a nonce to create the digest&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the initial request, no authentication is provided in the header because the client first needs to request the nonce. In the response from the DataGatewayServer, the nonce along with further information needed to create a digest is included in the HTTP header &amp;#039;&amp;#039;&amp;#039;Www-authenticate&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This request is acknowledged with the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; and the error message &amp;#039;&amp;#039;Authentication required!&amp;#039;&amp;#039; in the body.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Www-authenticate: Digest realm=&amp;quot;Restricted Area&amp;quot;,qop=&amp;quot;auth&amp;quot;,nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;,opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:21:41 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 24&lt;br /&gt;
 &lt;br /&gt;
Authentication required!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Request after receiving nonce&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
After the client has extracted the &amp;#039;&amp;#039;&amp;#039;nonce&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;realm&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;qop&amp;#039;&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;&amp;#039;opaque&amp;#039;&amp;#039;&amp;#039; from the initial request and generated the digest with them, it can be transmitted for authentication via the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The format is as follows:&amp;lt;br&amp;gt;&amp;#039;&amp;#039;Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;&amp;lt;REALM&amp;gt;&amp;quot;, nonce=&amp;quot;&amp;lt;NONCE&amp;gt;&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=&amp;lt;QOP&amp;gt;, nc=&amp;lt;NC&amp;gt;, cnonce=&amp;quot;&amp;lt;CNONCE&amp;gt;&amp;quot;, response=&amp;quot;&amp;lt;DIGEST&amp;gt;&amp;quot;, opaque=&amp;quot;&amp;lt;OPAQUE&amp;gt;&amp;quot;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The parameter &amp;#039;&amp;#039;&amp;#039;nc&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Nonce count&amp;quot; and &amp;#039;&amp;#039;&amp;#039;cnonce&amp;#039;&amp;#039;&amp;#039; = &amp;quot;Client nonce&amp;quot; are both generated by the client and must be used for creating the digest.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
Authorization: Digest username=&amp;quot;&amp;lt;USERNAME&amp;gt;&amp;quot;, realm=&amp;quot;Restricted Area&amp;quot;, nonce=&amp;quot;079ae550-11c1-40bf-9ee9-7cce5f1dd70e&amp;quot;, uri=&amp;quot;&amp;lt;ENDPOINT&amp;gt;&amp;quot;, algorithm=&amp;quot;MD5&amp;quot;, qop=auth, nc=00000001, cnonce=&amp;quot;PoYGQC6K&amp;quot;, response=&amp;quot;ce3fb921e353290142e34ac886694a4c&amp;quot;, opaque=&amp;quot;opaque&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of invalid authentication (using the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;), the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;client credentials invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 10:45:40 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 27&lt;br /&gt;
 &lt;br /&gt;
client credentials invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API Keys==&lt;br /&gt;
API key authentication is a simple method for securing API access. With this authentication method, the user/client is provided with a unique API key. This key must be included in the header of each API request.&lt;br /&gt;
&lt;br /&gt;
The server verifies the received API key to ensure that the request is coming from an authenticated user or application.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s crucial to securely store the API key to prevent unauthorized access. Additionally, regular updates to the API key are important to maintain security.&lt;br /&gt;
&lt;br /&gt;
The API key is managed within the DataGatewayServer. New keys can be generated or existing ones can be deleted. Multiple valid API keys can exist.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid API keys increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for a request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In this example, the API key &amp;#039;&amp;#039;apikey_heidler&amp;#039;&amp;#039; is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; For demonstration purposes, a simple API key is used in this example. The keys generated within the DataGatewayServer follow a more complex algorithm.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
x-api-key: apikey_heidler&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response on failed authentication&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In case of an incorrect API key, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned with the error message &amp;#039;&amp;#039;api key invalid!&amp;#039;&amp;#039; in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 09:46:30 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 16&lt;br /&gt;
 &lt;br /&gt;
api key invalid!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
===Client Credentials===&lt;br /&gt;
&lt;br /&gt;
OAuth 2.0 Client Credentials is an authentication method within the OAuth 2.0 protocol that allows an application to authenticate with the authorization server without user involvement. This is particularly useful for applications accessing APIs without user participation and is well-suited for server-to-server communication between services.&lt;br /&gt;
&lt;br /&gt;
The ERP system is registered on the authorization server and receives a unique client ID and client secret. Initially, the ERP sends an HTTP POST request to the authorization server including the client credentials (client ID and client secret). The response includes an access token and a refresh token. For authentication with each subsequent request, the ERP includes the access token in the authorization header of the HTTP requests. If the access token expires, a new access token can be requested by using the refresh token. A refresh token can only used once.&lt;br /&gt;
&lt;br /&gt;
In case of multiple uses of a refresh token, all refresh tokens and access tokens are automatically disabled.&lt;br /&gt;
&lt;br /&gt;
The client secret must be securely stored to prevent unauthorized access. Additionally, it&amp;#039;s important to regularly update the client secret to enhance security further.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The client ID and client secret are managed within the DataGatewayServer. New credentials can be created or existing ones can be deleted there.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; As the number of valid client IDs increases, so does the probability of unauthorized access being granted through a &amp;quot;brute-force attack.&amp;quot;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example of token request (generating access and refresh tokens with client ID + client secret)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For the token request, the client ID and client secret must be transmitted in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039;, base64 encoded in the format - &amp;#039;&amp;#039;Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&amp;#039;&amp;#039;. Additionally, the &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; with the value &amp;#039;&amp;#039;client_credentials&amp;#039;&amp;#039; is necessary for this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/token HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Basic &amp;lt;ClientID&amp;gt;:&amp;lt;ClientSecret&amp;gt;&lt;br /&gt;
grant_type: client_credentials&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the token request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the token request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token in seconds (expires_in) are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&lt;br /&gt;
&lt;br /&gt;
For security reasons, the access token has a limited validity. After expiration, the access token is no longer usable, and a HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; is returned. In this case, a new access token must be generated either through the refresh request with a valid refresh token (recommended), or through the token request with the client ID + client secret (not recommended).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Regularly generating access tokens through the token request is not recommended, as it involves transmitting the client ID + client secret. This increases vulnerability to Man-in-the-Middle (MitM) attacks. The client secret should be used as infrequently as possible.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:32 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
Cache-control: no-cache&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for using an access token&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The access token obtained from the token request can now be transmitted to the DataGatewayServer in the HTTP header &amp;#039;&amp;#039;&amp;#039;Authorization&amp;#039;&amp;#039;&amp;#039; to authenticate. It must be transmitted in the format - &amp;#039;&amp;#039;Bearer &amp;lt;Access token&amp;gt;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST &amp;lt;ENDPOINT&amp;gt; HTTP/1.1&lt;br /&gt;
Content-Type: application/json&lt;br /&gt;
Accept: application/json&lt;br /&gt;
Authorization: Bearer eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk3OTIsImp0aSI6ImM0ZDFkNTdiLWUzZTAtNDkwOC1hMDk4LWJiMjc2NmZmODdiMSIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.4zrctPAnBAlMj9CFUL6jQ33Gkou3V_bmcLBUrEsUKL0&lt;br /&gt;
Cache-Control: no-cache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Example header for the refresh request (renewing access and refresh tokens with a valid refresh token)&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If an access token has expired and needs to be renewed, a new access token + refresh token can be generated using the refresh request and a valid refresh token. In this request, the HTTP header &amp;#039;&amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;&amp;#039; must be transmitted with the refresh token, and the header &amp;#039;&amp;#039;&amp;#039;grant_type&amp;#039;&amp;#039;&amp;#039; must be transmitted with the value &amp;#039;&amp;#039;refresh_token&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
To enhance security against MitM attacks, it is recommended to regularly update the access token at short intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; A refresh token can only be used once for the refresh request. Afterwards, the token expires. If an invalid refresh token is used for authentication with the DataGatewayServer, for security reasons, all valid access and refresh tokens will be deactivated. Authentication must then be done again through the token request.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
POST /v2/hsc/auth/refresh HTTP/1.1&lt;br /&gt;
Accept: application/json&lt;br /&gt;
refresh_token: eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMxOTIsImp0aSI6IjEwMGZmN2JiLTQ1MzItNDFlNi05NTZjLTBjZjE0YWIzYTljNCIsInV1SUQiOiI0NTJiNWE4Ni1iZDRlLTRlNjktOGYxOC1hOGM5YWFlZTE1YzkiLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkxOTJ9.vAPo2Zobu2BNGNrUvmxKd5RVGWIn91sT83js33n2UUA&lt;br /&gt;
grant_type: refresh_token&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Response of the refresh request&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
In the response of the refresh request, the access token (access_token), refresh token (refresh_token), token type (token_type), and validity of the access token (expires_in) in seconds are returned in the body.&lt;br /&gt;
&lt;br /&gt;
The access token can now be used for authentication in subsequent requests.&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:06:43 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: 711&lt;br /&gt;
 &lt;br /&gt;
{&lt;br /&gt;
&amp;quot;access_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IkFDQ0VTUyIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJleHAiOjE3MDg5NDk4MDMsImp0aSI6ImJmYjgyZWE0LTU2NmEtNDc3ZS04NDRjLWRkM2VhYWZmZjQ1ZSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.vMoedyTSnfWXYXbGPZTX-nfhfNUAvp2upQJ3pTU-u_k&amp;quot;,&lt;br /&gt;
&amp;quot;refresh_token&amp;quot;: &amp;quot;eyJ1c2FnZSI6IlJFRlJFU0giLCJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MDk4MTMyMDMsImp0aSI6IjI5MTc0NzBkLTNjYTUtNGZiMC1hZDliLThjNjkxYWVjNDYzOSIsInV1SUQiOiI0ZmY5ZThhNC01YTY2LTQ0ZDQtYjY4Zi1jNjlmMzFiOTNiYjciLCJzdWIiOiJvZCIsImlzcyI6IkhTQy1ER1MiLCJpYXQiOjE3MDg5NDkyMDN9.DonI4KsNiTuG6pb705U3QIT7tNnU0pmDS7Tp6UZWHVk&amp;quot;,&lt;br /&gt;
&amp;quot;token_type&amp;quot;: &amp;quot;Bearer&amp;quot;,&lt;br /&gt;
&amp;quot;expires_in&amp;quot;: 600&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;line-height:1.6;&amp;quot;&amp;gt;Feedback on failed authentication - 401 Unauthorized&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
If authentication fails, the HTTP status code &amp;#039;&amp;#039;&amp;#039;401 Unauthorized&amp;#039;&amp;#039;&amp;#039; will be returned along with an appropriate error message in the body.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;http&amp;quot;&amp;gt;&lt;br /&gt;
HTTP/1.1 401 Unauthorized&lt;br /&gt;
Date: Mon, 26 Feb 2024 12:38:59 GMT&lt;br /&gt;
Content-type: application/json&lt;br /&gt;
Content-length: &amp;lt;LÄNGE&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;ERRORMESSAGE&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Authorization Code===&lt;br /&gt;
This authentication method is exclusively available through the authentication system [[IRIS_Cloudsystem|IRIS Cloudsystem]].&lt;/div&gt;</summary>
		<author><name>Odelice</name></author>
	</entry>
</feed>