Nested array felix console Configuration issue | Community
Skip to main content
imrank18551706
November 5, 2018
Solved

Nested array felix console Configuration issue

  • November 5, 2018
  • 10 replies
  • 3779 views

This issue is related to nested array in felix console configuraration.

Please find below code:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
   jcr:primaryType="sling:OsgiConfig"
   user.mapping="[com.adobe.granite.oauth.server=oauthservice,
  com.test.abc.project=[sling-scripting,serviceuser]]"/>

As we can see in below image the above code configuration ([sling-scripting,serviceuser]) should come in same line, but it is going in next line. After keeping comma(,) always moving the required configuration next line.

Thanks

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

Hi,

In JSP or HTL, the user always be sling-scripting. Though inside other components, services or servlets, it will be based on your service user mapping configuration.

10 replies

smacdonald2008
November 5, 2018

Looks like data was entered wrong. To use this service - the syntax should be:

Event64.core:datawrite=data

where:

  • Event64.core – is the Bundle-SymbolicName value of the OSGi bundle this is developed in the upcoming sections of this article.
  • datawrite – the name of the sub service (you reference this value in the Java code - used in the repository.loginServicemethod)
  • data – the system user account with data privileges.
smacdonald2008
November 5, 2018
imrank18551706
November 5, 2018

But the issue is something else, after building my above code, I am not able to keep [sling-scripting,serviceuser] in same section as you can find in above image.

[sling-scripting, is going to first section and serviceuser] is going to second question.

After installing bundle comma(,) is moving them in two different line.

Below is expected output after deploying

code

Thanks

smacdonald2008
November 5, 2018

Are you manually entering this line ?

smacdonald2008
November 5, 2018

Why are you using a comma?

You should use on each line the syntax i showed (from the docs)

Event64.core:datawrite=data

More information here - Service Users in AEM

No where does the syntax show use of a comma. Please enter the lines in the Apache Sling Service User Mapper service  according to the valid syntax.

From the Docs:

Service Users and Mappings

If the above fails, Sling 7 offers a Service User Mapping service, which allows to configure a bundle-to-user mapping and two corresponding API methods: SlingRepository.loginService() and ResourceResolverFactory.getServiceResourceResolver() which return a session/resource resolver with the privileges of a configured user only. These methods have the following characteristics:

  • They allow mapping services to users
  • They make it possinle to define sub-service users
  • The central configuration point is: org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl
  • service-id = service-name [ “:” subservice-name ]

  • service-id is mapped to a resource resolver and/or JCR repository user ID for authentication
  • service-name is the symbolic name of the bundle providing the service
imrank18551706
November 5, 2018

I wanted to assign two different system user to same bundle.

smacdonald2008
November 5, 2018

According to docs - its 1-1. You need two separate lines.

Lokesh_Shivalingaiah
November 5, 2018

Are those are the principleNames which you are mentioning ? Can you check the logs if it has logged anything for an invalid entry?

imrank18551706
November 5, 2018

Yes correct it will be giving resourceReslver with above mentioned characteristics:

I am trying to get resourceResolver on JSP page from testuser. But, it Is returning me sling-scripting user. In above code I have mapped sling-scripting with testuser.

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
November 6, 2018

Hi,

In JSP or HTL, the user always be sling-scripting. Though inside other components, services or servlets, it will be based on your service user mapping configuration.

Arun Patidar