Aem Asset API authentication
Hi,
I am trying to create an servlet which will be used to upload an asset to AEM. The whole author system is behind Microsoft OIDC authentication. So, in our case, we will be using bearer token to authenticate the servlet request.
I am trying to do a http post to the OOTB assets API.
However, the challenge here is the authentication for the OOTB assets API. If I use the bearer token in authorization header, it fails with the below error
com.adobe.granite.rest.impl.servlet.PostRequest Exception during request processing. java.lang.IllegalArgumentException: Can't create child on a synthetic root at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.create(ResourceResolverImpl.java:1004) at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.create(ResourceResolverImpl.java:1002) at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.create(ResourceResolverImpl.java:1002) at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.create(ResourceResolverImpl.java:1002) at com.adobe.granite.rest.impl.servlet.ModifyingRequest.createOrModifyResource(ModifyingRequest.java:121)
And the only way I am able to create an asset via this custom servlet is by calling the OOTB API via the direct IP with the basic admin credentials.
Is it possible to use token based authentication?
Best regards,
Vijaya Kumar A