Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Sling Authentication Handler - [ COOKIE BASED AUTHENTICATION ]

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Level 10
6 Replies

Avatar

Correct answer by
Level 10

Avatar

Level 2

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?

Avatar

Level 10

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. 

Avatar

Level 2

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.

Avatar

Level 2

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?