On Sat, Feb 13, 2010 at 7:36 AM, Jeppe Nejsum Madsen <[email protected]>wrote:
> Hi, > > As part of a project, I've made some improvements to the OpenId > attribute exchange. Together with > > https://www.assembla.com/spaces/liftweb/tickets/329-Make-OpenID-support-more-extensible > > this makes it possible to easily get attributes from different > providers. Ie you can write stuff like this: > > def ext(di:DiscoveryInformation, authReq: AuthRequest): Unit = { > import WellKnownAttributes._ > WellKnownEndpoints.findEndpoint(di) map {ep => > ep.makeAttrExtension(List(Email, FullName, FirstName, LastName)) > foreach {ex => authReq.addExtension(ex)}} > } > > > SimpleOpenIdVendor.OpenIdObject.is.beforeAuth = Full(ext _) > > object MyVendor extends SimpleOpenIdVendor { > override def postLogin(id: Box[Identifier],res: VerificationResult): Unit > = { > id match { > case Full(id) => > val attrs = > WellKnownAttributes.attributeValues(res.getAuthResponse) > > import WellKnownAttributes._ > val name = attrs.get(FullName) orElse attrs.get(FirstName) > getOrElse "Unknown" > val email = attrs.get(Email) getOrElse "" > > S.notice("Welcome "+name + " " + email) > case _ => S.error("Failed to authenticate") > } > > OpenIdUser(id) > } > } > > Is there interest in getting this into lift-openid? > That'd be very cool. > > /Jeppe > > -- > You received this message because you are subscribed to the Google Groups > "Lift" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<liftweb%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/liftweb?hl=en. > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
