Regex in the SHibboleth2.xml
Rick Hoodenpyle
rhoodenpyle at rms-inc.com
Fri Apr 29 19:48:35 UTC 2022
Hello again Christopher,
Thank you so much. The code you provided worked perfectly.
Cheers,
Rick
*From:* users <users-bounces at shibboleth.net> *On Behalf Of *Christopher
Bongaarts via users
*Sent:* 29 April 2022 20:12
*To:* users at shibboleth.net
*Cc:* Christopher Bongaarts <cab at umn.edu>
*Subject:* Re: Regex in the SHibboleth2.xml
On 4/29/2022 2:05 PM, Rick Hoodenpyle wrote:
I often have to separate username from the email address using the
following:
<!--<AttributeResolver type="Transform" source="upn">
<Regex match="^(.+)@(.+)$" <%5e(.+)@(.+)$>
dest="LoginID">$1</Regex>
<Regex match="^(.+)@(.+)$" <%5e(.+)@(.+)$>
dest="domain">$2</Regex>
</AttributeResolver>-->
I have a client though that passes an ID through the UID attribute. It
begins with a letter K and ends with the numerical ID, example K98456.
The value that this must equate to in my application is a numerical only
value, so I am needing to find out how to remove the K and only pass the
numbers. I have thought about maybe using the following, but have not had a
chance to test it and was wondering if someone out there might already know
how to do this.
<!--<AttributeResolver type="Transform" source="uid">
<Regex match="^(.+)[0-9](.+)$" dest="kuid">$1</Regex>
</AttributeResolver>-->
Given K followed by numbers, and extracting just the numbers, you would use
something like:
<Regex match="^K([0-9]+)$" dest="kuid">$1</Regex>
--
%% Christopher A. Bongaarts %% cab at umn.edu %%
%% OIT - Identity Management %% http://umn.edu/~cab %%
%% University of Minnesota %% +1 (612) 625-1809 %%
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20220429/867a4d30/attachment.htm>
More information about the users
mailing list