Unable to use default username password and make jsonResourcePassword.json work with Apereo CAS SSO

541 views Asked by At

Here is what I have done so far: https://github.com/jnbdz/tutorial-baeldung-spring-security-cas-sso

In here you can see my configs: https://github.com/jnbdz/tutorial-baeldung-spring-security-cas-sso/tree/main/config

I am trying to follow this tutorial: https://www.baeldung.com/spring-security-cas-sso

But it seems a bit out of date. I have re-written in my own words in the README.md file the updated tutorial. But now I am stuck.

None of the default username passwords work. And I even tried this:

cas.authn.accept.users=casuser::Mellon

But doesn't work either.

I verified the path to the jsonResourcePassword.json and it is good.

Same for the application.properties when I switch ports it changes it... So it is loading it.

I tried also adding:

cas.authn.pm.enabled=true

Like it is documented but I get an error saying it's not supported in this version of CAS.

You can also see in my repo what I have in the build.gradle.

So the question. Why isn't it loading the json file with the username password and why isn't it working with the default username password found in values.yml?

UPDATE

The setting:

cas.authn.accept.users=casuser::Mellon

Now seems to work.

I did this: sudo sysctl -w fs.inotify.max_user_instances=256

The value used to be 128.

I saw this in config-metadata.properties that I generate with: ./gradlew exportConfigMetadata

But I still cannot get he username and password in the json file to work.

So that issue still persists.

1

There are 1 answers

0
BJZ On

It seems like cas.authn.pm.json.location is used for password management only. You can not login with the credentials from that file.

If you want a JSON file with username/passwords to use while logging in, you need to use permissive authentication: https://apereo.github.io/cas/6.5.x/authentication/Permissive-Authentication.html

Tested on CAS 6.5.3:

  • Add implementation "org.apereo.cas:cas-server-support-generic" to your build.gradle.
  • Change cas.authn.pm.json.location to cas.authn.json.location.
  • Change your JSON file contents to the example given in the link above.