question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Felix filter execution order issue in AEM 6.2

See original GitHub issue

We have a felix filter handling the custom authentication in 6.1 similar to this acs aem sample filter. As per specification, Felix filter should get executed before Sling Engine. Thats happening in AEM 6.1 but NOT in AEM 6.2.

Steps to reproduce

  1. Deploy OSGi bundle with Sample Filter to AEM 6.1, 6.2
  2. Hit URL in new browser session
  3. Observe execution order in 6.1 (Filter -> Sling Authentication)
04.01.2018 11:31:44.131 *INFO* [qtp1030969174-68] com.sample.project.core.filters.SampleServletFilter Calling Sample Servlet Filter
04.01.2018 11:31:44.132 *INFO* [qtp1030969174-68] org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials
  1. Observe execution order in 6.2 (Sling Authentication -> Filter)
04.01.2018 11:26:33.364 *INFO* [qtp774039123-271] org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials
04.01.2018 11:26:33.378 *INFO* [0:0:0:0:0:0:0:1 [1515083193376] GET /libs/granite/core/content/login.html HTTP/1.1] com.sample.project.core.filters.SampleServletFilter Calling Sample Servlet Filter

Tried with service.ranking property also, but it doesn’t seems to be making a difference in AEM 6.2.

Additional Information - We are not yet on AEM 6.3, but tried the filter with modifications . Seems like the behavior is same as AEM 6.2.

Any pointers for this would help.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
davidjgonzalezcommented, Jan 12, 2018

Yeah - this sounds very much like the role of an authentication handler (or login module, but login modules are a bit of a pain so I tend to just use auth handlers)… sounds like you already have all the code so it seems like you’d just need to move it from the filter to the auth handler.

The saml use case might Warant looking at that hook example. That hook is derived from a use case where OOTB saml auth was used but upon successful auth, profile attributes has to be synced from sales force to aem, and the user had to also have their group membership shyster based on the sales force data.

0reactions
sandeepkumar03commented, Jan 11, 2018

Thanks @davidjgonzalez for sample authentication handler. We have a authentication provider outside AEM, so flow is like

User request (not authenticated, redirects user to Login page of authentication provider) -> Login screen of authentication provider (set required cookies after authentication) -> Back to AEM, Filter validates and creates user on AEM, establishes session.

Probably we can look at custom Sling Authentication Handler also. We had SAML based authentication in one other project, where authentication provider was posting SAML response and was handled on AEM side to create user, establish session.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: AEM 6.2 Filters - Adobe Experience League Community
Solved: We are currently working with an AEM 6.2 (SP1 is not installed) project, and I'm trying to understand and use filters for...
Read more >
Servlet Filter Support - Apache Sling
Sling supports filtering the request processing by applying filter chains to the requests before actually dispatching to the servlet or script for ...
Read more >
OSGi configuration details of AEM 6.2
Property Label Property id Property Type Enable Placeholder in place of Fragment showPlaceholder BOOLEAN Default Mode for Rule Editor af.ruleeditor.defaultmode STRING Number of Adaptive Forms maximumCacheEntries...
Read more >
Create custom pathbrowser predicate in AEM 6.2
The error you see can happen when you extend a class from the AEM API that's annotated with SCR annotations (used to generate...
Read more >
DS Annotations – dependency updates
With AEM 6.2, we can use the new Declarative Service annotations. These are improvements over Felix annotations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found