I'd like to add OpenID logins to my Lift app and would love a tutorial
about how to do so. I assume I mix OpenIDProtoUser into my User model,
but I don't know what to do beyond that. Can anyone point me in the
right direction?
Thanks!
Peter
PS This would make a great Wiki article.
Maybe, you can get some pointers there.
Take a look here:
http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala?view=markup
Dick
Co-Project Lead / Apache ESME
"The only Apache project written in Scala and based on Lift"
http://cwiki.apache.org/confluence/display/ESME/Index
Indeed. I have a blog post waiting for this (I know, lots of promises :-)
But here's a sample that should work:
object MyVendor extends SimpleOpenIDVendor {
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)}}
}
override def createAConsumer = new OpenIDConsumer[UserType] {
beforeAuth = Full(ext _)
}
}
object User extends User with MetaOpenIDProtoUser[User] with FancyKeyedMetaMapper[Long,User] with FancyCRUDify[Long,User] {
def openIDVendor = MyVendor
override def screenWrap = Full(<lift:surround with="default" at="content"><lift:bind /></lift:surround>)
override def dbTableName = "users"
override def homePage = if (loggedIn_?) "/dashboard" else "/"
}
class User extends OpenIDProtoUser[User] {
def getSingleton = User
}
And then in Boot
LiftRules.dispatch.append(model.MyVendor.dispatchPF)
LiftRules.snippets.append(model.MyVendor.snippetPF)
/Jeppe
Peter
I'm using the following lines in my SBT project declaration:
val lift = "net.liftweb" % "lift-mapper" % "2.0-SNAPSHOT" % "compile"
val liftOpenID = "net.liftweb" % "lift-openid" % "2.0-SNAPSHOT" %
"compile"
Unfortunately, when I try to import net.liftweb.openid._, I'm told it
doesn't exist. Anyone able to hazard a guess?
Thanks,
Peter
On Apr 8, 12:46 am, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
> Peter Robinett <pe...@bubblefoundry.com> writes:
> > Hi all,
>
> > I'd like to addOpenIDlogins to my Lift app and would love a tutorial
Sent from my iPhone
On 13 Apr 2010, at 03:51, Peter Robinett <pe...@bubblefoundry.com>
wrote:
> --
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
> .
>
>
Actually it turns out I hadn't called reload before calling update.
Sorry to pollute the list!