0

Generally speaking, I am trying to add a nested element inside another one, where the parent element does not contain a name attribute:

<parentElement name="fooName">
    <foo property1="abc"/>
</parentElement>

should become:

<parentElement name="fooName">
    <foo property1="abc">
        <fooChild property2="bcd"/>
    </foo>
</parent>

The problem with this is that I cannot find a way to properly build the path for the CLI command:

/sybsystem=xxx/parentElement=fooName/foo:add(fooChild={property2="bcd"})

gives me an error Node path format is wrong around 'foo' (index=37).

I assume this is because the foo element doesn't have an attribute name.


More specifically I am looking for a way to add key element inside the jwt element:

         <token-realm name="jwt-realm" principal-claim="sub">
                <jwt issuer="${JWT_ISSUER}" audience="${JWT_AUDIENCE}" public-key="${JWT_PUBLIC_KEY}"/>
         </token-realm>

should become:

           <token-realm name="jwt-realm" principal-claim="sub">
                <jwt issuer="${JWT_ISSUER}" audience="${JWT_AUDIENCE}" public-key="${JWT_PUBLIC_KEY}">
                    <key kid="xxx" public-key="${JWT_PUBLIC_KEY}"/>
                </jwt>
           </token-realm>

The command I am trying to use:

/subsystem=elytron/token-realm=jwt-realm/jwt:add(key={kid="xxx",public-key="${JWT_PUBLIC_KEY}"})

and the error I get: Node path format is wrong around 'jwt' (index=41).

Andremoniy
  • 34,031
  • 20
  • 135
  • 241

1 Answers1

0

Thanks to my outstanding colleague (he hasn't got an account here, shame), the answer has been found.

To update the key's map the following command can be used:

/subsystem=elytron/token-realm=jwt-realm:write-attribute(name=jwt, ... ,key-map={"xxx","${JWT_PUBLIC_KEY}"}}) 

(... here the list of other standard attributes of the jwt element).

Andremoniy
  • 34,031
  • 20
  • 135
  • 241