Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Omniauth for Lift
Scala
branch: 2.4M4

This branch is 3 commits ahead, 127 commits behind ghostm:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
demoproject
liftModuleJars
project/plugins
src
.gitignore
License.txt
README.markdown
build.sbt
build.xml

README.markdown

Lift-Omniauth Module

Usage

in Boot.scala

import omniauth.lib._
...
//Add Omniauth to the sitemap
Omniauth.sitemap
//Omniauth init
OmniauthLib.init

in your properties file define your client id (key) and secret for each provider you will use

omniauth.facebooksecret=...
omniauth.facebookkey=...

For Facebook provider you can set permissions. For example:

omniauth.facebookpermissions=email,read_stream    

After a user has logged into an auth provider you can access data through the session var OmniauthLib.currentAuthMap

OmniauthLib.currentAuthMap match {
  case Full(omni) => ({
    println(omni.get(OmniauthLib.Provider))
    println(omni.get(OmniauthLib.UID))
    println(omni.get(OmniauthLib.UserInfo))
  })
}

Installation

To install Lift-OmniAuth, simply add the Lift-Omniauth.jar to the build path and add Dispatch's Twitter as a dependancy. Using SBT: Add Lift-Omniauth.jar to the ./lib folder Add the following to your SBT project file.

val databinder_net = "databinder.net repository" at "http://databinder.net/repo"
val dispatch = "net.databinder" %% "dispatch-twitter" % "0.7.7"

Providers

Lift-OmniAuth currently supports the following external providers:

  • via OAuth
    • Facebook
    • Twitter
    • Github
Something went wrong with that request. Please try again.