Apereo CAS Login Error about java.security.InvalidAlgorithmParameterException

886 Views Asked by At

I follow the step in the link(https://github.com/apereo/cas-overlay-template) to deploy Apereo CAS.

Test Environment:

CAS Version: 7.0.0-SNAPSHOT

CAS Branch: master

CAS Build Date/Time: 2022-10-05T13:10:26Z

Spring Boot Version: 2.7.4

Spring Version: 5.3.23

Java Version: 17.0.4.1

OS Architecture: amd64

OS Name: Linux

OS Version: 3.10.0-1160.62.1.el7.x86_64

OS Date/Time: 2022-10-06T08:58:17.575986031

OS Temp Directory: /tmp

Apache Tomcat Version: Apache Tomcat/9.0.67

After run the following commands, I can access the CAS main page (https://xxx.xxx.xxx.xxx:8443/cas/login).

./gradlew clean build

./gradlew createKeystore

./gradlew run

But I got the error "CAS is unable to process this request: "500:Internal Server Error". In the terminal in which I start the CAS, error message as following:

ERROR [org.apereo.cas.web.flow.executor.EncryptedTranscoder] - java.security.InvalidAlgorithmParameterException: AlgorithmParameterSpec not of GCMParameterSpec

Unchecked.java:lambda$static$0:61

Unchecked.java:lambda$supplier$38:1698

FunctionUtils.java:doUnchecked:370

I can't find a proper solution by searching, so please help. thanks.

5

There are 5 best solutions below

0
Michael Shi On

Switch to Apereo CAS version 6.6 and Java 11 will work.

java --version
openjdk 11.0.16.1 2022-08-12 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.16.1.1-1.el7_9) (build 11.0.16.1+1-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.16.1.1-1.el7_9) (build 11.0.16.1+1-LTS, mixed mode, sharing)

git checkout 6.6

./gradlew clean build

./gradlew createKeystore

./gradlew run
0
user20797908 On

One workaround is to set cas.webflow.crypto.enabled=false, but doing so isn't ideal.

0
ATFWUS On

I have solved this problem perfectly. The problem is that the jdk version actually used by your cas is not the same as the version viewed through java --version. You only need to check whether the jdk version in the cas startup log is the same.

1
ReZero On

Don't use the Orcale jdk, I had the same problem as you with this. It works fine for me with Amazon Corretto-17. My Environment Configuration

0
irbian On

It's a bug. After some debugging I arrived to this

cas.webflow.crypto.encryption.keySize=32

But I don't know enough to submit a pull request