Skip to main content
sagarp14731432
Level 2
December 4, 2017
Solved

Sling Authentication Handler - [ COOKIE BASED AUTHENTICATION ]

  • December 4, 2017
  • 6 replies
  • 5206 views

Hi all,

  • I reffered the below sling documentation for sling authentication handler
    Apache Sling :: Authentication - AuthenticationHandler
  • What has to be configured in AEM OGSI bundle Apache Sling Authentication Service
  • And should we do any additional work in SlingServlet rather than the below code

@SlingServlet(paths = "/bin/upload/jsoncontent", methods = "GET", metatype = false)

public class CMTServlet extends SlingSafeMethodsServlet {

  private final Logger log = LoggerFactory.getLogger(getClass()); }

=> I am facing 403 while trying to hit above servlet using Apache Authentication Handler...

=> How to solve it ?

=> I want my Sling Servlet to be protected?

Thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
December 4, 2017
sagarp14731432
Level 2
December 4, 2017

Thanks for the blog. It was usefull.

I want to hit the servlet directly with the URL below from a cross domain [ out of AEM ]
Example: http://localhost:4200/bin/upload/json?username="admin"?password="admin"

How can I do it?

smacdonald2008
Level 10
December 4, 2017

Typically, authentication handlers are called from components within AEM - such as a LOGIN Component - as discussed here -- Scott's Digital Community: Creating a Login Component for the Experience Manager Toy Store

This one invokes the default one however. 

sagarp14731432
Level 2
December 5, 2017

Hey Scott,

I'll rephrase my original question. I would like to create a Sling Servlet which is protected. This servlet will be accessed from an external application. I'm looking for a way to authenticate with AEM and then call this servlet? Looking for ways to implement this.

smacdonald2008
Level 10
December 5, 2017
sagarp14731432
Level 2
December 5, 2017

I am facing this error on build of the bundle
org.apache.sling.jcr.jackrabbit.server.security,version=[2.0,3) -- Cannot be resolved

Which version should I use for It? How to solve this issue?