How to convert email address to username?

Mohamed Lrhazi lrhazi at cua.edu
Sat Feb 20 15:18:18 UTC 2021


Thanks Peter.

For me this seems to work perfectly:

  <util:list id="shibboleth.authn.Password.Transforms">
        <bean parent="shibboleth.Pair" p:first="^(.+)@.*$" p:second="$1" />
    </util:list>

In our case the email address is just not desirable. In our LDAP the
attribute exists but is not guaranteed to be accurate at all.



On Sat, Feb 20, 2021 at 7:51 AM Peter Schober <peter.schober at univie.ac.at>
wrote:

> * Peter Schober <peter.schober at univie.ac.at> [2021-02-20 13:44]:
> > * Mohamed Lrhazi <lrhazi at cua.edu> [2021-02-19 22:22]:
> > > Sometimes our users enter their email address at our IdP login
> > > page... How would one go about removing @doma.ain part before
> > > authentication and any attribute processing etc....
> >
> > You could also simply authenticate on either the username *or* the
> > email adress making both work seamlessly, avoiding the need for any
> > transformations (whether in-browser or on the server).
>
> N.B.: That has a potential side-effect on what "the" authenticated
> principal is, then. E.g. if you're using the "PrincipalName"-type
> AttributeDefinition you'd end up with either an email address or a
> username.
> I'd avoid "PrincipalName" in attribute defintions if possible anyway
> and instead look up the -- hopefully normalized values -- from LDAP or
> your RDBMS, which also avoids any case inconsistencies.
>
> This also supports more complex transformations (going from
> email-adress to username or vice versa) than would be possible via
> regex-based Transformations. (E.g. in our deployment you can't derive
> the username from the email address at all, you'd have to perform a
> look-up.)
>
> -peter
> --
> For Consortium Member technical support, see
> https://wiki.shibboleth.net/confluence/x/coFAAg
> To unsubscribe from this list send an email to
> users-unsubscribe at shibboleth.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20210220/c33f638d/attachment.htm>


More information about the users mailing list