A little help with messages.properties

Wessel, Keith kwessel at illinois.edu
Thu Feb 10 03:50:46 UTC 2022


Thanks, Scott. Maybe I need to step back and ask a more elementary question.

The default event for not passing a context check is ContextCheckDenied. In messages.properties baked into the IdP (specifically in messages.properties tucked away in idp-conf-impl*.jar, ContextCheckDenied is mapped as:

ContextCheckDenied = context-check-denied

I sort of assumed that this assignment then gets passed on. For instance, I define context-check-denied.message in my messages.properties, not ContextCheckDenied.message.

What I was trying to do with my first line was the same thing:

contextCheckDenied-https\://sp.example.illinois.edu/shibboleth = sp-example-context-check-denied

I sort of assumed that I could then start the other message keys with the portion before the dot being the cleaner-looking sp-example-context-check-denied.*.

Apologies for the upper-case S in Sp in my earlier message. That was Outlook trying to be smart, not what I actually had in the file.

I'll try what you said of echoing out the keys that it's looking for before trying to resolve the keys. That easy enough to do and making good use of the velocity template. But am I correct in my assumption above? Is that the purpose of lines like ContextCheckDenied = context-check-denied?

And am I also correct that I need to escape the colon?

Thanks,
Keith


-----Original Message-----
From: users <users-bounces at shibboleth.net> On Behalf Of Cantor, Scott
Sent: Wednesday, February 9, 2022 8:46 PM
To: Shib Users <users at shibboleth.net>
Subject: Re: A little help with messages.properties

Taken literally I don't see any of those values lining up with what you're trying to put in the file, even if one assumes you have entityID populated correctly. I would probably start by just echoing out those message variables you're constructing to make sure they match the keys in the file. I don't think they do.

e.g.:
            #set ($header = $springMacroRequestContext.getMessage("${eventKey}-${entityID}.header", "$defaultHeader"))

That would seem to be "ContextCheckDenied-entityID.header", not "sp-example-context-check-denied.header".

>    Alternatively, what logging class would I turn up to see details logging for message resolution?

I guess some Spring class maybe, but I would just echo out the message key strings (maybe assign them to a variable, echo that out, and pass the variable into the message function.

I think you just don't have the macros right, even if the basic idea is fine. You probably mean to be looking up a message "key" based on the event and entityID, and then using the message key you retrieved to construct the other message keys using those suffixes. That just doesn't look like what you're actually doing.

-- Scott


-- 
For Consortium Member technical support, see https://urldefense.com/v3/__https://shibboleth.atlassian.net/wiki/x/ZYEpPw__;!!DZ3fjg!t1lsdFzQCPmNow36_Xxa6dGMZek4yQFF31vxO54_-ZzfAEyKNXPQSEaQvOGBUsJiCg$ 
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net


More information about the users mailing list