Differences

This shows you the differences between two versions of the page.

Link to this comparison view

261:configure_stages [2026/03/13 16:58] – created - external edit 127.0.0.1261:configure_stages [2026/11/23 13:06] (current) – Prinz, Patrick
Line 102: Line 102:
 ==== Variable replacement ==== ==== Variable replacement ====
  
- - requires Stages ''7.10.5.0'' or newer -+- requires Stages ''7.10.5.0'' or newer -
  
 This allows to keep the critical configuration files ''server.xml'', ''config.xml'' and ''database.properties'' server independent and therefore shareable, while e.g. environment specific server names and passwords are managed in the server specific config.properties and secret.properties files. This allows to keep the critical configuration files ''server.xml'', ''config.xml'' and ''database.properties'' server independent and therefore shareable, while e.g. environment specific server names and passwords are managed in the server specific config.properties and secret.properties files.
Line 702: Line 702:
   </cg-host>   </cg-host>
  
- In methodpark\stages\conf+In methodpark\stages\conf
  
 Create a folder tokenizer\custom-model-v1 ← make sure the folder name exactly matches the value in the tokenizerFolder property Create a folder tokenizer\custom-model-v1 ← make sure the folder name exactly matches the value in the tokenizerFolder property
Line 805: Line 805:
 </code> </code>
  
 +===== AI Feature oAuth Configuration: How to use oAuth with AI Ressources =====
  
 +For some external systems (e.g. API gateways), Stages needs to authenticate itself with an Access Token. Typically Access Tokens can be acquired from an authentication server/IdP using the OAuth Client Credentials workflow. The authentication server responds with the token value and the respective expiration date. Stages caches acquired tokens and automatically refreshes them upon new requests, if expired. OAuth clients can be configured in the oauth-client section like this:
 +
 +<code>
 +<oauth-clients>
 +  <oauth-client ident="myclient" endpoint="${oauth.tokenendpoint}">
 +    <client-property name="clientId" value="${oauth.clientid}"/>
 +    <client-property name="clientSecret" value="${oauth.clientsecret}"/>
 +    <client-property name="scope" value="${oauth.scope}"/>
 +  </oauth-client>
 +</oauth-clients>
 +</code>
 +
 +The oAuth client configuration gets referenced in the ai host sections via it's ident like this:
 +
 +<code>
 +<cg-host ident="trainingModel" url="${ai.model.training.url}" displayName="${ai.model.training.displayName}">
 +    <cg-property name="user" value="${ai.security.user}"/>
 +    <cg-property name="key" value="${ai.model.training.key}"/>
 +    <cg-property name="deployment_name" value="${ai.model.training.deploymentName}"/>
 +    <cg-property name="costsPerInputToken" value="2.5"/>
 +    <cg-property name="costsPerOutputToken" value="10.0"/>
 +    <cg-property name="logRequestsAndResponses" value="true"/>
 +    <cg-property name="oAuthClient" value="myclient"/>
 +    <cg-custom-header key="a_custom_header_key" value="a_custom_header_value" /> <-- e.g. bearer token
 +</cg-host>
 +</code>