Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » unable to create signature(problems with scout security when starting the hello world example ui)
unable to create signature [message #1849211] Sat, 08 January 2022 10:47 Go to next message
Christian Elsasser is currently offline Christian ElsasserFriend
Messages: 2
Registered: January 2022
Junior Member
Hi there,

I'm new to Scout and am currently trying to build a simple example based on the HelloScout example using IntelliJ as IDE in Win10.

I added a page with a list displaying some object data. Both server and ui started, so far so good.

Then I added a RestClient to get the data from a remote source and when I try to start the UI-Server, I now run into a very strange exception:

2022-01-08 11:32:43,308 WARN  [scout-thread-3] org.eclipse.scout.rt.platform.job.internal.CallableChainExceptionHandler.intercept(CallableChainExceptionHandler.java:62) - Exception in callable chain. - MDC[]
java.io.IOException: org.eclipse.scout.rt.platform.exception.ProcessingException: unable to create signature. [severity=ERROR]
	at org.eclipse.scout.rt.shared.servicetunnel.http.HttpServiceTunnel.addSignatureHeader(HttpServiceTunnel.java:155)
	at org.eclipse.scout.rt.shared.servicetunnel.http.HttpServiceTunnel.addCustomHeaders(HttpServiceTunnel.java:143)
	at org.eclipse.scout.rt.shared.servicetunnel.http.HttpServiceTunnel.executeRequest(HttpServiceTunnel.java:119)
	at org.eclipse.scout.rt.shared.servicetunnel.http.RemoteServiceInvocationCallable.call(RemoteServiceInvocationCallable.java:78)
	at org.eclipse.scout.rt.shared.servicetunnel.http.RemoteServiceInvocationCallable.call(RemoteServiceInvocationCallable.java:1)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxMandatory(TransactionProcessor.java:156)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxRequired(TransactionProcessor.java:139)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.intercept(TransactionProcessor.java:78)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.context.RunContext.call(RunContext.java:158)
	at org.eclipse.scout.rt.platform.context.RunContextRunner.intercept(RunContextRunner.java:38)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.job.internal.CallableChainExceptionHandler.intercept(CallableChainExceptionHandler.java:33)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.lambda$0(JobFutureTask.java:106)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.run(JobFutureTask.java:175)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.eclipse.scout.rt.platform.job.internal.NamedThreadFactory$1.run(NamedThreadFactory.java:63)
Caused by: org.eclipse.scout.rt.platform.exception.ProcessingException: unable to create signature. [severity=ERROR]
	at org.eclipse.scout.rt.platform.security.SunSecurityProvider.createSignature(SunSecurityProvider.java:281)
	at org.eclipse.scout.rt.platform.security.SecurityUtility.createSignature(SecurityUtility.java:288)
	at org.eclipse.scout.rt.platform.security.SecurityUtility.createSignature(SecurityUtility.java:308)
	at org.eclipse.scout.rt.shared.servicetunnel.http.DefaultAuthTokenSigner.signature(DefaultAuthTokenSigner.java:130)
	at org.eclipse.scout.rt.shared.servicetunnel.http.DefaultAuthTokenSigner.sign(DefaultAuthTokenSigner.java:124)
	at org.eclipse.scout.rt.shared.servicetunnel.http.DefaultAuthTokenSigner.createDefaultSignedToken(DefaultAuthTokenSigner.java:75)
	at org.eclipse.scout.rt.shared.servicetunnel.http.HttpServiceTunnel.addSignatureHeader(HttpServiceTunnel.java:149)
	... 24 common frames omitted
Caused by: java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: IOException : null
	at jdk.crypto.ec/sun.security.ec.ECKeyFactory.engineGeneratePrivate(ECKeyFactory.java:169)
	at java.base/java.security.KeyFactory.generatePrivate(KeyFactory.java:384)
	at org.eclipse.scout.rt.platform.security.SunSecurityProvider.createSignature(SunSecurityProvider.java:266)
	... 30 common frames omitted
Caused by: java.security.InvalidKeyException: IOException : null
	at java.base/sun.security.pkcs.PKCS8Key.decode(PKCS8Key.java:350)
	at java.base/sun.security.pkcs.PKCS8Key.decode(PKCS8Key.java:355)
	at jdk.crypto.ec/sun.security.ec.ECPrivateKeyImpl.<init>(ECPrivateKeyImpl.java:74)
	at jdk.crypto.ec/sun.security.ec.ECKeyFactory.implGeneratePrivate(ECKeyFactory.java:237)
	at jdk.crypto.ec/sun.security.ec.ECKeyFactory.engineGeneratePrivate(ECKeyFactory.java:165)
	... 32 common frames omitted
2022-01-08 11:32:43,308 ERROR [scout-thread-2 ClientNotificationPoller] org.eclipse.scout.rt.client.clientnotification.ClientNotificationPoller.run(ClientNotificationPoller.java:119) - Error receiving client notifications - MDC[principal=notification-authenticator, jobName=ClientNotificationPoller]
org.eclipse.scout.rt.platform.exception.PlatformException: org.eclipse.scout.rt.platform.exception.ProcessingException: unable to create signature. [severity=ERROR] [translator=org.eclipse.scout.rt.platform.exception.DefaultRuntimeExceptionTranslator, user=notification-authenticator, calling-thread=scout-thread-2 ClientNotificationPoller, job=Tunneling service request [seq=1, submitter=ClientNotificationPoller]]
	at org.eclipse.scout.rt.platform.exception.DefaultRuntimeExceptionTranslator.translateInternal(DefaultRuntimeExceptionTranslator.java:54)
	at org.eclipse.scout.rt.platform.exception.DefaultRuntimeExceptionTranslator.translate(DefaultRuntimeExceptionTranslator.java:37)
	at org.eclipse.scout.rt.platform.exception.DefaultRuntimeExceptionTranslator.translate(DefaultRuntimeExceptionTranslator.java:1)
	at org.eclipse.scout.rt.platform.job.internal.JobExceptionTranslator.translateExecutionException(JobExceptionTranslator.java:65)
	at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.awaitDoneAndGet(JobFutureTask.java:411)
	at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.awaitDoneAndGet(JobFutureTask.java:400)
	at org.eclipse.scout.rt.shared.servicetunnel.http.HttpServiceTunnel.tunnel(HttpServiceTunnel.java:230)
	at org.eclipse.scout.rt.shared.servicetunnel.AbstractServiceTunnel.invokeService(AbstractServiceTunnel.java:48)
	at org.eclipse.scout.rt.shared.servicetunnel.AbstractServiceTunnel.invokeService(AbstractServiceTunnel.java:40)
	at org.eclipse.scout.rt.shared.servicetunnel.http.HttpServiceTunnel.invokeService(HttpServiceTunnel.java:192)
	at org.eclipse.scout.rt.shared.servicetunnel.ServiceTunnelProxyProducer.invoke(ServiceTunnelProxyProducer.java:51)
	at org.eclipse.scout.rt.platform.interceptor.DecoratingProxy.invokeImpl(DecoratingProxy.java:137)
	at org.eclipse.scout.rt.platform.interceptor.DecoratingProxy$P_InvocationHandler.invoke(DecoratingProxy.java:170)
	at com.sun.proxy.$Proxy22.getNotifications(Unknown Source)
	at org.eclipse.scout.rt.client.clientnotification.ClientNotificationPoller$P_NotificationPoller.lambda$0(ClientNotificationPoller.java:107)
	at org.eclipse.scout.rt.platform.util.concurrent.Callables.lambda$0(Callables.java:31)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxMandatory(TransactionProcessor.java:156)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxRequired(TransactionProcessor.java:139)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.intercept(TransactionProcessor.java:78)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.context.RunContext.call(RunContext.java:158)
	at org.eclipse.scout.rt.platform.context.RunContext.call(RunContext.java:139)
	at org.eclipse.scout.rt.platform.context.RunContext.run(RunContext.java:110)
	at org.eclipse.scout.rt.client.clientnotification.ClientNotificationPoller$P_NotificationPoller.run(ClientNotificationPoller.java:105)
	at org.eclipse.scout.rt.platform.util.concurrent.Callables.lambda$0(Callables.java:31)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.job.internal.ExceptionProcessor.intercept(ExceptionProcessor.java:41)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxRequiresNew(TransactionProcessor.java:113)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxRequired(TransactionProcessor.java:142)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.intercept(TransactionProcessor.java:78)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/javax.security.auth.Subject.doAs(Subject.java:423)
	at org.eclipse.scout.rt.platform.security.SubjectProcessor.intercept(SubjectProcessor.java:43)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.context.RunContext.call(RunContext.java:158)
	at org.eclipse.scout.rt.platform.context.RunContextRunner.intercept(RunContextRunner.java:38)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.job.internal.CallableChainExceptionHandler.intercept(CallableChainExceptionHandler.java:33)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.lambda$0(JobFutureTask.java:106)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.run(JobFutureTask.java:175)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.eclipse.scout.rt.platform.job.internal.NamedThreadFactory$1.run(NamedThreadFactory.java:63)


I have seen similar Stacks here in the forum, but yet could make not heads or tails out of it, especially since I fail to see a connection between the changes I made and the sudden appearance of the error... Any suggestions?

Kind regards,
Christian
Re: unable to create signature [message #1849241 is a reply to message #1849211] Mon, 10 January 2022 08:07 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 232
Registered: September 2011
Senior Member
Hi Christian

A few questions to narrow down the issue:
1. Which JRE version do you use to start the application?
2. Which Scout version do you use?
3. What are the values of the properties "scout.auth.privateKey" and "scout.auth.publicKey" in your config.properties files?

Thanks
Mat
Re: unable to create signature [message #1849243 is a reply to message #1849241] Mon, 10 January 2022 08:57 Go to previous messageGo to next message
Christian Elsasser is currently offline Christian ElsasserFriend
Messages: 2
Registered: January 2022
Junior Member
Hi Mat,

thanks for the quick reply.

"1. Which JRE version do you use to start the application?" -> openJDK 17.0.1
"2. Which Scout version do you use?" -> 11.0.42
"3. What are the values of the properties "scout.auth.privateKey" and "scout.auth.publicKey" in your config.properties files?" -> they where both "changeme"/ the default since the helloworld-tutorial did not include instructions to change them. Or I missed those.

However, in the meantime I have been able to run the SecurityUtility and now have set the keys to the generated value and with that I was able to get the app running again. I still don't get though why this became an issue at all when all I changed was adding some new classes on the client side.

[Updated on: Mon, 10 January 2022 08:59]

Report message to a moderator

Re: unable to create signature [message #1849245 is a reply to message #1849243] Mon, 10 January 2022 09:04 Go to previous message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 232
Registered: September 2011
Senior Member
Hi Christian

Glad that you could make it work. Probably this was always an issue as creating new classes on the client side has nothing to do with that.

Please note that Scout 11 does not officially support Java 17 yet. This has never been tested! To be on the safe side I recommend using Java 11 instead.

Basically you should not need to change these values manually as they should be generated together with the project. Maybe these values are not generated because you use Java 17 (which is not supported). When using Java 11 you should get valid values for these properties out of the box.

Kind regards
Mat
Previous Topic:Eclipse Scout and log4j2 vulnerability (CVE-2021-44228)
Next Topic:Eclipse Scout 11 : NPM download root
Goto Forum:
  


Current Time: Thu May 09 00:35:06 GMT 2024

Powered by FUDForum. Page generated in 0.03653 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top