You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice that the server does not start and produces the following stack trace instead:
2025-01-20 14:49:25 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'preconfigurationLoaderInitializer' defined in URL [jar:nested:/application/basyxExecutable.jar/!BOOT-INF/lib/basyx.aasenvironment-core-2.0.0-milestone-03.jar!/org/eclipse/digitaltwin/basyx/aasenvironment/preconfiguration/PreconfigurationLoaderInitializer.class]: An error occurred while attempting to decode the Jwt: Signed JWT rejected: Invalid signature
2025-01-20 14:49:25 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1806) ~[spring-beans-6.1.11.jar!/:6.1.11]
2025-01-20 14:49:25 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.11.jar!/:6.1.11]
2025-01-20 14:49:25 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.11.jar!/:6.1.11]
2025-01-20 14:49:25 at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) ~[spring-beans-6.1.11.jar!/:6.1.11]
2025-01-20 14:49:25 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.11.jar!/:6.1.11]
2025-01-20 14:49:25 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) ~[spring-beans-6.1.11.jar!/:6.1.11]
2025-01-20 14:49:25 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.1.11.jar!/:6.1.11]
2025-01-20 14:49:25 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) ~[spring-beans-6.1.11.jar!/:6.1.11]
2025-01-20 14:49:25 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:971) ~[spring-context-6.1.11.jar!/:6.1.11]
2025-01-20 14:49:25 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625) ~[spring-context-6.1.11.jar!/:6.1.11]
2025-01-20 14:49:25 at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.3.2.jar!/:3.3.2]
...
Expected behavior
The server starts successfully.
BaSyx (please complete the following information):
BaSyx Java SDK
Additional context
To me, the problem seems to be that the public key is not retrieved from the keycloak server (http://localhost:8080/realms/BaSyx/) but built from a fixed combination of modulus and exponent:
Describe the bug
Using authorized preconfiguration loader fails with message 'Signed JWT rejected: Invalid signature'.
To Reproduce
Steps to reproduce the behavior:
BaSyx
realm and a client 'workstation-1' withservice-account-roles
(example is based on theBaSyxSecured
example from here).docker-compose.yml
aas-env.properties
Expected behavior
The server starts successfully.
BaSyx (please complete the following information):
Additional context
To me, the problem seems to be that the public key is not retrieved from the keycloak server (http://localhost:8080/realms/BaSyx/) but built from a fixed combination of modulus and exponent:
basyx-java-server-sdk/basyx.aasenvironment/basyx.aasenvironment-feature-authorization/src/main/java/org/eclipse/digitaltwin/basyx/aasenvironment/feature/authorization/AuthorizedAASEnvironmentPreconfigurationLoader.java
Line 108 in 0a7a5d5
This leads to the fact that the AuthorizedAASEnvironmentPreconfigurationLoader should only work with only those exact keys that are specified in the sample realm (https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/0a7a5d57926fe74eb6477661d3ccbed00c099538/examples/BaSyxSecured/keycloak/realm/BaSyx-realm.json).
The text was updated successfully, but these errors were encountered: