Expression for kid in TokenRealm

30 views
Skip to first unread message

Anita Malcolm

unread,
Jun 24, 2024, 8:54:51 PM (13 days ago) Jun 24
to WildFly
Hi all,
   I am trying to use environment variables to set claim attributes for authentication. While using these env expressions works for all other attributes, it does not seem to work for kid. 

                <token-realm name="JwtRealm" principal-claim="${env.JWT_PRINCIPAL_CLAIM}">
                    <jwt issuer="${env.JWT_ISSUER}" audience="${env.JWT_AUDIENCE}">
                         <key kid= "${env.JWT_KID}"   public-key="${env.JWT_PUBLIC_KEY}"/>  
                    </jwt>
                </token-realm>
The above configuration works only if I replace it with kid=xxxxxxxx - the actual kid value. I found an older thread that discusses this - https://groups.google.com/g/wildfly/c/_kB6nQjrbmQ/m/8YwM4VxzAgAJ 
Just wondering if this is still the case or if this is being addressed in a release.
Thanks,
Anita 

Prarthona Paul

unread,
Jun 26, 2024, 9:24:26 AM (11 days ago) Jun 26
to WildFly
Hello there, 
I believe that is still the case. 
You can find the description for various attributes and elements inside the Token Realm resource here: https://github.com/wildfly/wildfly-core/blob/98d3c3561f489b1c26288345deb4a4aa77c45c58/elytron/src/main/java/org/wildfly/extension/elytron/TokenRealmDefinition.java

As you can see, something like Issuer, or audience allows you to use expressions, indicated with "setAllowExpression(true)". But this is not the case for kid. 

If there isn't an issue created for that, please feel free to do so. 

Best, 
Prarthona
Reply all
Reply to author
Forward
0 new messages