Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Two Factor Authentication


Level 1


I have a requirement to implement 2FA. There will be some pages that require 1FA and other pages that require 2FA. So if the user tries to access a page that requires 1FA, they are redirected to external login page (we're using OIDC). Once 1FA authentication is successful, the user is presented with the 1FA page. Next, if the user clicks on a page that requires 2FA, they need to be redirected to 2FA external auth page.

Question is, how do we determine that the page requires 2FA for users that are already 1FA authenticated?

To enforce 1FA, there are couple of ways to restrict page access to authenticated users, such as CUG, or setting explicit authentication requirement through OSGI config in Apache Sling Authentication Service. But now that the user is already logged in, how do we designate that a certain page requires 2FA?

Came across this OTP Auth community article but this does not suite our use case, since it asks for 1FA and 2FA in one go.

Should we try page property and a sling filter that will check for the page property and redirect accordingly? Will there be any concerns with the Dispatcher caching in this case?

Thanks in advance!

1 Reply


Level 1

Is there an option to add a custom privilege type? Or any other suggestions?

Thank you!