Cannot import XML values that has been protected (/system/console/crypto)

Avatar

Avatar
Validate 25
Level 4
jayv25585659
Level 4

Likes

46 likes

Total Posts

131 posts

Correct reply

0 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Validate 25
Level 4
jayv25585659
Level 4

Likes

46 likes

Total Posts

131 posts

Correct reply

0 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 5
View profile
jayv25585659
Level 4

16-04-2019

So I encrypted a text using this page: http://localhost:4502/system/console/crypto

I then copy/paste the protected text to an OSGI Service config XML

<?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"
   my.protected.text1="{sdsd834dfsdsfsdfsdfsdsfsdfsfsdfsdfdsfsdfs}"
/>

Note: The protected value I used in this XML above is fake. This is only an example.

When I import my code package into AEM, my.protected.text1 is empty/blank. If I change the value in the XML to something like "qwerty". The value gets imported.

Any ideas what I'm doing wrong?

Thanks

Replies

Avatar

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile
Gaurav-Behl
MVP

16-04-2019

Could you share your code to understand what exactly is happening?

Check if you see any warning/error in error.log?

Avatar

Avatar
Validate 10
Level 3
gargsahil099
Level 3

Likes

13 likes

Total Posts

57 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 10
Level 3
gargsahil099
Level 3

Likes

13 likes

Total Posts

57 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile
gargsahil099
Level 3

17-04-2019

Hi Jay,

It is the isssue with XML parser (org.xml.sax.SAXException)

  1. <?xml version="1.0" encoding="UTF-8"?> 
  2. <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 
  3.    jcr:primaryType="sling:OsgiConfig" 
  4.   my.protected.text1="sdsd834dfsdsfsdfsdfsdsfsdfsfsdfsdfdsfsdfs" 
  5. /> 

Remove the curly braces from both side of value of my.protected.text1 make it like "sdsd834dfsdsfsdfsdfsdsfsdfsfsdfsdfdsfsdfs" it will start working for you.

Please let me know if you still face any issue.

Thanks

Sahil Garg

Avatar

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile
Gaurav-Behl
MVP

17-04-2019

I assume that you got the correct solution via What's the correct way of storing passwords in AEM?