fixed zoho - refresh token function

This commit is contained in:
Ralph Soika 2025-07-14 13:24:05 +02:00
parent 1e698fc8bf
commit 67affba4d7
7 changed files with 7 additions and 97 deletions

5
devi
View file

@ -64,11 +64,7 @@ if [[ "$(strip_dash $1)" == "deploy" ]]; then
mvn clean install -Pkubernetes -DskipTests
fi
if [[ "$(strip_dash $1)" == "deploy-oidc" ]]; then
echo " Deploy to Imixs-Cloud..."
mvn clean install -Pkubernetes-oidc -DskipTests
fi
# Überprüfen, ob keine Parameter übergeben wurden - standard build
if [[ $# -eq 0 ]]; then
@ -80,7 +76,6 @@ if [[ $# -eq 0 ]]; then
echo " -hot : Manik Hotdeploy Starten"
echo " -test : Run tests"
echo " -deploy: Imixs-Cloud Deployment starten "
echo " -deploy-oidc: Imixs-Cloud Deployment mit SSO starten "
echo " -setup : Developer Umgebung neu aufbauen und Docker Container starten "
echo "_________________________________________"
echo " "

View file

@ -123,74 +123,6 @@
</plugins>
</build>
</profile>
<profile>
<id>kubernetes-oidc</id>
<!-- oidc -->
<dependencies>
<dependency>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-office-workflow-oidc</artifactId>
<scope>compile</scope>
<version>${org.imixs.office.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<filtering>true</filtering>
<directory>src/oidc/</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>install</phase>
<configuration>
<target>
<exec executable="docker">
<arg value="build" />
<arg value="-t" />
<arg
value="imixs/${imixs-office.applicationname}-oidc:${project.version}" />
<arg value="../." />
</exec>
<exec executable="docker">
<arg value="tag" />
<arg
value="imixs/${imixs-office.applicationname}-oidc:${project.version}" />
<arg
value="${org.imixs.kubernetes.registry}/imixs/${imixs-office.applicationname}-oidc:${project.version}" />
</exec>
<exec executable="docker">
<arg value="push" />
<arg
value="${org.imixs.kubernetes.registry}/imixs/${imixs-office.applicationname}-oidc:${project.version}" />
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<testResources>

View file

@ -62,7 +62,8 @@ public class ZohoOAuthManager {
@Lock(LockType.READ)
public String getValidAccessToken() throws PluginException {
logger.fine("├── get Zoho AccessTokens");
ItemCollection zohoConfig = configService.loadConfiguration(ZohoController.ZOHO_CONFIGURATION, false);
// Discard Config Cache!
ItemCollection zohoConfig = configService.loadConfiguration(ZohoController.ZOHO_CONFIGURATION, true);
String accessToken = zohoConfig.getItemValueString("zoho.accessToken");
logger.fine("│ ├── accessToken=" + accessToken);
logger.fine("│ ├── refresh=" + zohoConfig.getItemValueString("zoho.refreshToken"));
@ -124,13 +125,6 @@ public class ZohoOAuthManager {
String clientID = zohoConfig.getItemValueString("zoho.clientid");
String clientSecret = zohoConfig.getItemValueString("zoho.clientsecret");
// String requestUrl = zohoConfig.getItemValueString("zoho.oauth.uri") +
// "?code="
// + URLEncoder.encode(code, StandardCharsets.UTF_8) + "&client_id="
// + URLEncoder.encode(clientID, StandardCharsets.UTF_8) + "&client_secret="
// + URLEncoder.encode(clientSecret, StandardCharsets.UTF_8) + "&redirect_uri="
// + URLEncoder.encode(redirectURI, StandardCharsets.UTF_8) +
// "&grant_type=authorization_code";
String requestUrl = zohoConfig.getItemValueString("zoho.oauth.uri") + "?code="
+ URLEncoder.encode(code, StandardCharsets.UTF_8) + "&client_id="
@ -181,7 +175,8 @@ public class ZohoOAuthManager {
public String refreshAccessToken() throws PluginException {
logger.info("├── refresh Zoho access token");
ItemCollection zohoConfig = configService.loadConfiguration(ZohoController.ZOHO_CONFIGURATION, false);
// discard config cache!
ItemCollection zohoConfig = configService.loadConfiguration(ZohoController.ZOHO_CONFIGURATION, true);
String clientID = zohoConfig.getItemValueString("zoho.clientid");
String clientSecret = zohoConfig.getItemValueString("zoho.clientsecret");

View file

@ -86,11 +86,6 @@
<form-error-page>/loginerror.jsf</form-error-page>
</form-login-config>
</login-config>
-->
<!--
<login-config>
<auth-method>OIDC</auth-method>
</login-config>
-->
<!-- Security Roles -->

View file

@ -90,10 +90,6 @@
<id>kubernetes</id>
<!-- build and push to rep - see ear module for details -->
</profile>
<profile>
<id>kubernetes-oidc</id>
<!-- build and push to rep - see ear module for details -->
</profile>
</profiles>

View file

@ -4110,10 +4110,7 @@ Betrag: <itemvalue>_amount</itemvalue> (Brutto € <itemvalue>_amount_brutto</it
<cargosoft name="task">1000</cargosoft>
<cargosoft name="event">100</cargosoft>
<cargosoft name="items">(?!txtworkflowhistory)(^[a-zA-Z]|^_)</cargosoft>
<taxonomy name="sachpruefung">
<type>stop</type>
<anonymised>false</anonymised>
</taxonomy>
]]></imixs:value>
</imixs:item>
<imixs:item name="txtname" type="xs:string">

View file

@ -514,7 +514,7 @@ Company: <itemvalue>document.company</itemvalue><br />]]></imixs:value>
<imixs:value><![CDATA[<imixs-ai name="PROMPT">
<endpoint>https://llama.cpp.imixs.com/</endpoint>
<result-event>XML</result-event>
<debug>true</debug>
<debug>false</debug>
</imixs-ai>
<imixs-ai name="SUGGEST">
<items>cdtr.name,invoice.number,invoice.date,invoice.total,payment.date,cdtr.iban,cdtr.bic,total</items>
@ -900,7 +900,7 @@ Note: Do not generate any other information instead of the XML object. Do not ge
<imixs:value><![CDATA[<imixs-ai name="PROMPT">
<endpoint>https://llama.cpp.imixs.com/</endpoint>
<result-item>invoice.summary</result-item>
<debug>true</debug>
<debug>false</debug>
</imixs-ai>
<validation name="required">false</validation>