Locate an Attribute Resolver

Greg Haverkamp gahaverkamp at lbl.gov
Mon Oct 2 03:00:07 EDT 2017


This is pretty evident in the distributed example in the MFA config.

However, here’s an example:

AttributeResolutionContext resCtx = (AttributeResolutionContext)
profileRequestContext.getSubcontext(AttributeResolutionContext.class,
true);

Be sure to remove it later if you want the normal attribute resolution
process to happen:

profileRequestContext.removeSubcontext(resCtx);


Greg



On Sun, Oct 1, 2017 at 3:32 PM Samuel Bristot Loli <bristot at gmail.com>
wrote:

> Hello All,
>
> Sorry for the doubts, I'm starting in the shib world.
>
> I developed a new authentication flow that is being called as the second
> factor through mfa-config-flow. I need to get the user attributes from the
> response of the first authentication factor "Password" to use in my
> authentication flow. Reading the documentation, I came up with this code:
>
> Ps.: My question is in the code comment.
>
> public String TestLoginService(AuthenticationContext
> authenticationContext, ProfileRequestContext<?, ?> profileRequestContext) {
>         SubjectCanonicalizationContext sub =
> (SubjectCanonicalizationContext)
> profileRequestContext.getSubcontext("net.shibboleth.idp.authn.context.SubjectCanonicalizationContext");
>         AttributeResolutionContext att = (AttributeResolutionContext)
> authenticationContext.getSubcontext("net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext",
> true);
>         att.setPrincipal(sub.getPrincipalName());
>         att.getRequestedIdPAttributeNames().add("mail");
>         att.getRequestedIdPAttributeNames().add("eduPersonPrincipalName");
>         att.getRequestedIdPAttributeNames().add("uid");
>         att.resolveAttributes(?)
>         //I don't now how to get an AttributeResolver objects to call the
> method att.resolveAttributes, which expects an AttributeResolver as
> parameter.
>         IdPAttribute emailAttr =
> att.getResolvedIdPAttributes().get("mail");
>         IdPAttribute uid = att.getResolvedIdPAttributes().get("uid");
>         IdPAttribute eppn =
> att.getResolvedIdPAttributes().get("eduPersonPrincipalName");
>     }
>
> Thanks!
> --
> 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/20171002/12ac469b/attachment-0001.html>


More information about the users mailing list