Hello,
I am implementing Per Application – Multifactor Authentication Triggers in CAS 7.1.5 using Google Authenticator (mfa-gauth) with MongoDB token storage.
The module used is:
Google Authenticator configuration in cas.properties (issuer, label, crypto keys, mongo, etc.) is correctly set up. The flow works properly when using Global Multifactor Authentication Trigger.
The registered service contains:
When using Per Application MFA Trigger:
If the user already has a registered TOTP token → MFA works correctly.
If the user does NOT have a registered device → CAS grants login directly.
The Google Authenticator registration flow (QR page) is NOT triggered.
Logs only show SERVICE_TICKET_CREATED.
However, when configuring Global Multifactor Authentication Trigger, the behavior is correct:
If the user has no registered device → CAS redirects automatically to the QR registration flow.
MFA is properly enforced.
I would expect Per Application MFA to behave the same way:
Trigger device registration flow when no device exists.
Prevent service ticket issuance until MFA registration is completed.
Is this the expected behavior of Per Application MFA in CAS 7.1.5?
Is there any additional property or configuration required to force device registration when MFA is defined at the service level?
Here are my cas.properties settings:
Thank you.
Hi Frédéric,
Thank you for your previous response.
I am currently running CAS 7.2.7, which (as mentioned) should already include the corrected behavior for Per-Application MFA triggers.
I have configured my registered service in MongoDB with the following multifactorPolicy:
multifactorPolicy : {
"_class" : "org.apereo.cas.services.DefaultRegisteredServiceMultifactorPolicy",
"multifactorAuthenticationProviders" : [
"java.util.LinkedHashSet",
[
"mfa-gauth"
]
],
"bypassEnabled" : false,
"forceExecution" : true
}
The Google Authenticator configuration in cas.properties remains the same (issuer, label, crypto keys, Mongo token storage, etc.).
However, the behavior is still the following:
When I access:
http://localhost:8080/cas/login?service=MyService
I enter username and password
CAS immediately grants a service ticket
The Google Authenticator MFA screen is NOT shown
If the user does not have a registered device, the registration (QR) flow is not triggered
If I enable Global MFA Trigger instead, everything works correctly:
Users without a registered device are redirected to the registration flow
MFA is properly enforced before issuing the service ticket
So even on 7.2.7, Per-Application MFA does not appear to enforce device registration.
My questions are:
Is there any additional configuration required in 7.2.7 to force device registration when MFA is defined at the service level?
Does Per-Application MFA require a specific trigger configuration beyond the multifactorPolicy block?
Could this be related to Account Management being enabled?
Thank you for your help.
Best regards,
Christian