SlideShare a Scribd company logo
1 of 25
Download to read offline
SecureSocial
Authentication Module for Play!
              Jorge Aliss
               @jaliss



           Sponsored by
Agenda
Overview
Main concepts: Identity Providers, Identity, UserService
Installation
Configuration
Protecting Actions
UsernamePassword provider
Password rules and hashing algorithms
Views customization
Internationalization
Extending SecureSocial
Overview
What does it do?
Why did I do it?
11/11/2011: First release (Play 1)
06/05/2012: Play 2 version
Demo
Identity Providers
A provider implements the logic required to support an
               authentication scheme.
          OAuth 1: Twitter, LinkedIn
          OAuth 2: Facebook, Google, GitHub
          OpenID (coming soon)
          Username and Password
          Your own provider
Identity
Represents a user in a Provider
Providers return an instance of this trait upon successful
authentication
Modeled with a trait in Scala and an interface on the Java API

 tatIett {
  ri dniy
   dfi:UeI
    e d srd
   dffrtae Srn
    e isNm: tig
   dflsNm:Srn
    e atae tig
   dfflNm:Srn
    e ulae tig
   dfeal Oto[tig
    e mi: pinSrn]
   dfaaaUl Oto[tig
    e vtrr: pinSrn]
   dfatMto:AtetctoMto
    e uhehd uhniainehd
   dfouhIf:Oto[At1no
    e At1no pinOuhIf]
   dfouhIf:Oto[At2no
    e At2no pinOuhIf]
   dfpswrIf:Oto[asodno
    e asodno pinPswrIf]
 }
UserService
Provides a way to persist/find Identities from a backing store
No imposed persistence mechanism. Developer is free to
use anything
Any class implementing Identity can be returned: this allows
you to return your own model class

 tatUeSrie{
  ri srevc
   dffn(d UeI)Oto[dniy
    e idi: srd:pinIett]
   dffnBEalnPoie(mi:Srn,poieI:Srn)Oto[dni
    e idymiAdrvdreal tig rvdrd tig:pinIett
 y]
   dfsv(sr Iett)
    e aeue: dniy
   / temtosta hnl tkn aeue
    / h ehd ht ade oes r sd
   / i sg u adrstpswr rqet
    / n in p n ee asod euss
   dfsv(oe:Tkn
    e aetkn oe)
   dffnTkntkn Srn) Oto[oe]
    e idoe(oe: tig: pinTkn
   dfdltTknui:Srn)
    e eeeoe(ud tig
   dfdltEprdoes)
    e eeexieTkn(
 }
Installation
      Available as a downloadable dependency
      Stable versions and master snapshots

ojc Apiainul etnsBid{
 bet plctoBid xed ul
   vlapae
    a pNm    ="yp"
               MAp
   vlapeso
    a pVrin  ="."
               10

   vlapeednis=Sq
    a pDpnece    e(
       "eueoil %"eueoil291 %".."
        scrsca"  scrsca_.."  207
   )
   vlmi =PaPoetapae apeso,apeednis miLn =S
    a an    lyrjc(pNm, pVrin pDpnece, anag C
AA.etns
 L)stig(
     rsles+ Rsle.r(ScrSca Rpstr" ul"tp/scrs
      eovr = eovrul"eueoil eoioy, r(ht:/eue
oilw/eoioyrlae/)(eovriytlPten)
 ca.srpstr/eess")Rsle.vSyeatrs
   )
}
Configuration
Settings go in a securesocial section of your conf file
Global settings: onLoginGoto, onLogoutoTo, ssl

   scrsca {
    eueoil
      oLgnoo/
       noiGT=
      oLguGT=lgn
       nootoo/oi
      slfle
       s=as
   }
Configuration
Username Password Provider

ueps {
 sras
  wtUeNmSpotfle
   ihsraeupr=as
  snWloemi=re
   edecmEaltu
  ealGaaaSpottu
   nbervtrupr=re
  tknuain6
   oeDrto=0
  tkneeenevl5
   oeDltItra=
  ealTkno=re
   nbeoeJbtu
  hse=cyt
   ahrbrp
  mnmmasodegh8
   iiuPswrLnt=
}
Configuration
       OAuth 1 and OAuth 2 based providers

titr{
 wte
   rqetoeUl"tp:/wte.o/at/eus_oe"
    eusTknr=hts/titrcmouhrqettkn
   acsTknr=hts/titrcmouhacs_oe"
    cesoeUl"tp:/wte.o/at/cestkn
   atoiainr=hts/titrcmouhatetct"
    uhrztoUl"tp:/wte.o/at/uhniae
   cnueKyyu_osmrky
    osmre=orcnue_e
   cnueSce=orcnue_ert
    osmrertyu_osmrsce
}

fcbo {
 aeok
   atoiainr=hts/gahfcbo.o/at/uhrz"
    uhrztoUl"tp:/rp.aeokcmouhatoie
   acsTknr=hts/gahfcbo.o/at/cestkn
    cesoeUl"tp:/rp.aeokcmouhacs_oe"
   cinI=orcin_d
    letdyu_leti
   cinSce=orcin_ert
    letertyu_letsce
   soeeal
    cp=mi
}
Protecting Actions
SecuredAction: intercepts requests and redirects them to a
login page if the user is not authenticated (returns
unauthorized error for ajax calls)
Authorization: SecuredActions can receive an Authorization
instance that checks if an authenticated user is authorized to
execute it. Renders an error page (returns forbidden for ajax
calls)
SecuredAction
    Add the SecureSocial trait to your controllers

dfmAto =Scrdcin{ipii rqet=
 e ycin   eueAto  mlct eus >
   O(iw.tlidxrqetue)
    kveshm.ne(eus.sr)
}

dfmAaCl =Scrdcintu){ipii rqet=
 e yjxal   eueAto(re   mlct eus >
   O(sntJo(a(msae - "el").sJO)
    kJo.osnMp"esg" > hlo))a(SN
}
Authorization
To add authorization logic to an action you need to implement
                   the Authorization trait.

   cs casWtRl(oe Rl)etnsAtoiain{
    ae ls ihoerl: oe xed uhrzto
      dfiAtoie(dniy Iett) Boen={
       e suhrzdiett: dniy: ola
        iett mth{
         dniy ac
          cs ue:Ue = ue.aRl(oe
           ae sr sr > srhsoerl)
          cs _=
           ae   >
            Lge.ro(DdntgtaSsinsrojc"
             ogrerr"i o e  esoUe bet)
            fle
             as
        }
      }
   }

   dfmAto =Scrdcin WtRl(di)){ipii rqet=
    e ycin   eueAto( ihoeAmn  mlct eus >
      O(iw.tlidxrqetue)
       kveshm.ne(eus.sr)
   }
UsernamePassword
            Provider
Enforces flows that prevent leaking information in the
Signup, Login and Password recovery flows
Password change functionality
Enforces password strength and hashing
Password Validator
Used to enforce password strength
DefaultPasswordValidator: checks length specified in settings
file
To customize, implement the PasswordValidator and register
it in the play.plugins file

   tatPswrVldtretnsPui {
    ri asodaiao xed lgn
     dfiVldpswr:Srn) Boen
      e sai(asod tig: ola
     dferresg:Srn
      e roMsae tig
   }
Password Hasher
Built in (and recommended) is based on Bcrypt
Several can be configured, allowing easy migration to new
algorithms as needed
PasswordInfo: stores the hashed password, an optional salt
and the hasher id
Passwords are hashed with the 'default' hasher

 tatPswrHse etnsPui wt Rgsrbe{
  ri asodahr xed lgn ih eital
   dfhs(liPswr:Srn) PswrIf
    e ahpanasod tig: asodno
   dfmthspswrIf:PswrIf,splePswr:Srn) Boen
    e ace(asodno asodno upidasod tig: ola
 }
Views Customization
Built in templates use Twitter Bootstrap
TemplatesPlugin: used to render views/emails
To customize: change css or implement and register it
instead of the default one

 dfgtoiPg[]ipii rqet RqetA,
  e eLgnaeA(mlct eus: eus[]
           fr:Fr[Srn,Srn),
            om om(tig tig]
           mg Oto[tig =Nn) Hm
            s: pinSrn]  oe: tl

 dfgtinpmi(oe:Srn)ipii rqet Rqetedr:Srn
  e eSgUEaltkn tig(mlct eus: eusHae) tig


 dfgtoiPg[]ipii rqet RqetA,
  e eLgnaeA(mlct eus: eus[]
            fr:Fr[Srn,Srn),
             om om(tig tig]
            mg Oto[tig =Nn) Hm =
             s: pinSrn] oe: tl
 {
   scrsca.iw.tllgnfr,mg
    eueoilveshm.oi(om s)
 }

 dfgtinpmi(oe:Srn)ipii rqet Rqetedr:Srn ={
  e eSgUEaltkn tig(mlct eus: eusHae) tig
    scrsca.iw.tlmissgUEaltkn.oy
     eueoilveshm.al.inpmi(oe)bd
 }
Internationalization
Built in messages are extracted
To customize: copy the messages from the sources into your
messages file and change as needed

 scrsca.oi.il=oi
  eueoillgntteLgn
 scrsca.oi.eehr
  eueoillgnhr=ee
 scrsca.oi.naiCeetasIvldCeetas
  eueoillgnivldrdnil=nai rdnil
 scrsca.oi.ogtasodDdyufre yu pswr?
  eueoillgnfroPswr=i o ogt or asod
Creating an Identity
          Provider
asrc casIettPoie(plcto:Apiain
 btat ls dniyrvdrapiain plcto)
    etnsPui wt Rgsrbe
     xed lgn ih eital
{
  .
  .

 dfdAt[])ipii rqet RqetA)Ete[eut ScaUe]
  e ouhA((mlct eus: eus[]:ihrRsl, oilsr
 dfflPoieue:ScaUe)ScaUe
  e ilrfl(sr oilsr:oilsr

 .
 .
}
What's next
OpenID support
More providers (eg:Foursquare, Wordpress, Yahoo).
Account linking support
Main Sponsor

  Previous sponsor
Q&A
Links
Project site: http://www.securesocial.ws
GitHub: https://github.com/jaliss/securesocial
Thank you
  Scala BASE

More Related Content

What's hot

JFugue, Music, and the Future of Java [JavaOne 2016, CON1851]
JFugue, Music, and the Future of Java [JavaOne 2016, CON1851]JFugue, Music, and the Future of Java [JavaOne 2016, CON1851]
JFugue, Music, and the Future of Java [JavaOne 2016, CON1851]David Koelle
 
The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 56 of 196
The Ring programming language version 1.7 book - Part 56 of 196The Ring programming language version 1.7 book - Part 56 of 196
The Ring programming language version 1.7 book - Part 56 of 196Mahmoud Samir Fayed
 
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo PlatformNuxeo
 
Offensive PowerShell Cheat Sheet
Offensive	PowerShell Cheat SheetOffensive	PowerShell Cheat Sheet
Offensive PowerShell Cheat SheetRahmat Nurfauzi
 
The Ring programming language version 1.4 book - Part 15 of 30
The Ring programming language version 1.4 book - Part 15 of 30The Ring programming language version 1.4 book - Part 15 of 30
The Ring programming language version 1.4 book - Part 15 of 30Mahmoud Samir Fayed
 
Real Time Web with Node
Real Time Web with NodeReal Time Web with Node
Real Time Web with NodeTim Caswell
 
Node Powered Mobile
Node Powered MobileNode Powered Mobile
Node Powered MobileTim Caswell
 
The Ring programming language version 1.3 book - Part 42 of 88
The Ring programming language version 1.3 book - Part 42 of 88The Ring programming language version 1.3 book - Part 42 of 88
The Ring programming language version 1.3 book - Part 42 of 88Mahmoud Samir Fayed
 
Building an Ethereum Wallet using Hashicorp Vault
Building an Ethereum Wallet using Hashicorp VaultBuilding an Ethereum Wallet using Hashicorp Vault
Building an Ethereum Wallet using Hashicorp VaultJeff Ploughman
 
The Ring programming language version 1.5.3 book - Part 62 of 184
The Ring programming language version 1.5.3 book - Part 62 of 184The Ring programming language version 1.5.3 book - Part 62 of 184
The Ring programming language version 1.5.3 book - Part 62 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 51 of 185
The Ring programming language version 1.5.4 book - Part 51 of 185The Ring programming language version 1.5.4 book - Part 51 of 185
The Ring programming language version 1.5.4 book - Part 51 of 185Mahmoud Samir Fayed
 
GeeCON 2013 - EJB application guided by tests
GeeCON 2013 - EJB application guided by testsGeeCON 2013 - EJB application guided by tests
GeeCON 2013 - EJB application guided by testsJakub Marchwicki
 
The Ring programming language version 1.5.2 book - Part 51 of 181
The Ring programming language version 1.5.2 book - Part 51 of 181The Ring programming language version 1.5.2 book - Part 51 of 181
The Ring programming language version 1.5.2 book - Part 51 of 181Mahmoud Samir Fayed
 
Asynchronous java script
Asynchronous java scriptAsynchronous java script
Asynchronous java scriptRon Martin
 
The Ring programming language version 1.6 book - Part 54 of 189
The Ring programming language version 1.6 book - Part 54 of 189The Ring programming language version 1.6 book - Part 54 of 189
The Ring programming language version 1.6 book - Part 54 of 189Mahmoud Samir Fayed
 

What's hot (20)

JFugue, Music, and the Future of Java [JavaOne 2016, CON1851]
JFugue, Music, and the Future of Java [JavaOne 2016, CON1851]JFugue, Music, and the Future of Java [JavaOne 2016, CON1851]
JFugue, Music, and the Future of Java [JavaOne 2016, CON1851]
 
The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212
 
The Ring programming language version 1.7 book - Part 56 of 196
The Ring programming language version 1.7 book - Part 56 of 196The Ring programming language version 1.7 book - Part 56 of 196
The Ring programming language version 1.7 book - Part 56 of 196
 
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
[Webinar] An Hour with the CTO: All About APIs and the Nuxeo Platform
 
Offensive PowerShell Cheat Sheet
Offensive	PowerShell Cheat SheetOffensive	PowerShell Cheat Sheet
Offensive PowerShell Cheat Sheet
 
The Ring programming language version 1.4 book - Part 15 of 30
The Ring programming language version 1.4 book - Part 15 of 30The Ring programming language version 1.4 book - Part 15 of 30
The Ring programming language version 1.4 book - Part 15 of 30
 
Real Time Web with Node
Real Time Web with NodeReal Time Web with Node
Real Time Web with Node
 
The ABCs of OTP
The ABCs of OTPThe ABCs of OTP
The ABCs of OTP
 
Node Powered Mobile
Node Powered MobileNode Powered Mobile
Node Powered Mobile
 
The Ring programming language version 1.3 book - Part 42 of 88
The Ring programming language version 1.3 book - Part 42 of 88The Ring programming language version 1.3 book - Part 42 of 88
The Ring programming language version 1.3 book - Part 42 of 88
 
Building an Ethereum Wallet using Hashicorp Vault
Building an Ethereum Wallet using Hashicorp VaultBuilding an Ethereum Wallet using Hashicorp Vault
Building an Ethereum Wallet using Hashicorp Vault
 
Intro to Redis
Intro to RedisIntro to Redis
Intro to Redis
 
The Ring programming language version 1.5.3 book - Part 62 of 184
The Ring programming language version 1.5.3 book - Part 62 of 184The Ring programming language version 1.5.3 book - Part 62 of 184
The Ring programming language version 1.5.3 book - Part 62 of 184
 
The Ring programming language version 1.5.4 book - Part 51 of 185
The Ring programming language version 1.5.4 book - Part 51 of 185The Ring programming language version 1.5.4 book - Part 51 of 185
The Ring programming language version 1.5.4 book - Part 51 of 185
 
GeeCON 2013 - EJB application guided by tests
GeeCON 2013 - EJB application guided by testsGeeCON 2013 - EJB application guided by tests
GeeCON 2013 - EJB application guided by tests
 
root-ksk-2010
root-ksk-2010root-ksk-2010
root-ksk-2010
 
The Ring programming language version 1.5.2 book - Part 51 of 181
The Ring programming language version 1.5.2 book - Part 51 of 181The Ring programming language version 1.5.2 book - Part 51 of 181
The Ring programming language version 1.5.2 book - Part 51 of 181
 
Asynchronous java script
Asynchronous java scriptAsynchronous java script
Asynchronous java script
 
The Ring programming language version 1.6 book - Part 54 of 189
The Ring programming language version 1.6 book - Part 54 of 189The Ring programming language version 1.6 book - Part 54 of 189
The Ring programming language version 1.6 book - Part 54 of 189
 
gemdiff
gemdiffgemdiff
gemdiff
 

Similar to SecureSocial Authentication Module for Play

Clojurescript up and running
Clojurescript up and runningClojurescript up and running
Clojurescript up and runningTimo Sulg
 
Building modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaBuilding modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaAlexander Gyoshev
 
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best PracticesJohannes Hoppe
 
Creating windows store java script apps
Creating windows store java script appsCreating windows store java script apps
Creating windows store java script appsEugene Zharkov
 
nescala 2013
nescala 2013nescala 2013
nescala 2013Hung Lin
 
Refactoring to symfony components
Refactoring to symfony componentsRefactoring to symfony components
Refactoring to symfony componentsMichael Peacock
 
JavaScript Design Patterns
JavaScript Design PatternsJavaScript Design Patterns
JavaScript Design PatternsDerek Brown
 
Arquillian - extensions which you have to take with you to a deserted island
Arquillian - extensions which you have to take with you to a deserted islandArquillian - extensions which you have to take with you to a deserted island
Arquillian - extensions which you have to take with you to a deserted islandSoftwareMill
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleAri Lerner
 
A Backbone.js Tutorial for the Impatient - Part 1
A Backbone.js Tutorial for the Impatient - Part 1A Backbone.js Tutorial for the Impatient - Part 1
A Backbone.js Tutorial for the Impatient - Part 1jsalonen Salonen
 
Theme Development and Customization
Theme Development and CustomizationTheme Development and Customization
Theme Development and CustomizationAniket Pant
 
Drupal 8 in action, the route to the method
Drupal 8 in action, the route to the methodDrupal 8 in action, the route to the method
Drupal 8 in action, the route to the methodjuanolalla
 
Making Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in MeteorMaking Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in Meteoryaliceme
 
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...Ari Lerner
 
An Introduction to CSS Preprocessors
An Introduction to CSS PreprocessorsAn Introduction to CSS Preprocessors
An Introduction to CSS PreprocessorsMiloš Sutanovac
 
Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaTony Fabeen
 

Similar to SecureSocial Authentication Module for Play (20)

JavaFX, because you're worth it
JavaFX, because you're worth itJavaFX, because you're worth it
JavaFX, because you're worth it
 
Clojurescript up and running
Clojurescript up and runningClojurescript up and running
Clojurescript up and running
 
Building modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaBuilding modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and java
 
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
 
Creating windows store java script apps
Creating windows store java script appsCreating windows store java script apps
Creating windows store java script apps
 
nescala 2013
nescala 2013nescala 2013
nescala 2013
 
Refactoring to symfony components
Refactoring to symfony componentsRefactoring to symfony components
Refactoring to symfony components
 
JavaScript Design Patterns
JavaScript Design PatternsJavaScript Design Patterns
JavaScript Design Patterns
 
Arquillian - extensions which you have to take with you to a deserted island
Arquillian - extensions which you have to take with you to a deserted islandArquillian - extensions which you have to take with you to a deserted island
Arquillian - extensions which you have to take with you to a deserted island
 
Arquillian Extensions
Arquillian ExtensionsArquillian Extensions
Arquillian Extensions
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at Google
 
A Backbone.js Tutorial for the Impatient - Part 1
A Backbone.js Tutorial for the Impatient - Part 1A Backbone.js Tutorial for the Impatient - Part 1
A Backbone.js Tutorial for the Impatient - Part 1
 
Theme Development and Customization
Theme Development and CustomizationTheme Development and Customization
Theme Development and Customization
 
Drupal 8 in action, the route to the method
Drupal 8 in action, the route to the methodDrupal 8 in action, the route to the method
Drupal 8 in action, the route to the method
 
Starting out with Ember.js
Starting out with Ember.jsStarting out with Ember.js
Starting out with Ember.js
 
Oracle RDBMS Workshop (Part1)
Oracle RDBMS Workshop (Part1)Oracle RDBMS Workshop (Part1)
Oracle RDBMS Workshop (Part1)
 
Making Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in MeteorMaking Mongo realtime - oplog tailing in Meteor
Making Mongo realtime - oplog tailing in Meteor
 
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...
 
An Introduction to CSS Preprocessors
An Introduction to CSS PreprocessorsAn Introduction to CSS Preprocessors
An Introduction to CSS Preprocessors
 
Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with Lua
 

Recently uploaded

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

SecureSocial Authentication Module for Play

  • 1. SecureSocial Authentication Module for Play! Jorge Aliss @jaliss Sponsored by
  • 2. Agenda Overview Main concepts: Identity Providers, Identity, UserService Installation Configuration Protecting Actions UsernamePassword provider Password rules and hashing algorithms Views customization Internationalization Extending SecureSocial
  • 3. Overview What does it do? Why did I do it? 11/11/2011: First release (Play 1) 06/05/2012: Play 2 version
  • 5. Identity Providers A provider implements the logic required to support an authentication scheme. OAuth 1: Twitter, LinkedIn OAuth 2: Facebook, Google, GitHub OpenID (coming soon) Username and Password Your own provider
  • 6. Identity Represents a user in a Provider Providers return an instance of this trait upon successful authentication Modeled with a trait in Scala and an interface on the Java API tatIett { ri dniy dfi:UeI e d srd dffrtae Srn e isNm: tig dflsNm:Srn e atae tig dfflNm:Srn e ulae tig dfeal Oto[tig e mi: pinSrn] dfaaaUl Oto[tig e vtrr: pinSrn] dfatMto:AtetctoMto e uhehd uhniainehd dfouhIf:Oto[At1no e At1no pinOuhIf] dfouhIf:Oto[At2no e At2no pinOuhIf] dfpswrIf:Oto[asodno e asodno pinPswrIf] }
  • 7. UserService Provides a way to persist/find Identities from a backing store No imposed persistence mechanism. Developer is free to use anything Any class implementing Identity can be returned: this allows you to return your own model class tatUeSrie{ ri srevc dffn(d UeI)Oto[dniy e idi: srd:pinIett] dffnBEalnPoie(mi:Srn,poieI:Srn)Oto[dni e idymiAdrvdreal tig rvdrd tig:pinIett y] dfsv(sr Iett) e aeue: dniy / temtosta hnl tkn aeue / h ehd ht ade oes r sd / i sg u adrstpswr rqet / n in p n ee asod euss dfsv(oe:Tkn e aetkn oe) dffnTkntkn Srn) Oto[oe] e idoe(oe: tig: pinTkn dfdltTknui:Srn) e eeeoe(ud tig dfdltEprdoes) e eeexieTkn( }
  • 8. Installation Available as a downloadable dependency Stable versions and master snapshots ojc Apiainul etnsBid{ bet plctoBid xed ul vlapae a pNm ="yp" MAp vlapeso a pVrin ="." 10 vlapeednis=Sq a pDpnece e( "eueoil %"eueoil291 %".." scrsca" scrsca_.." 207 ) vlmi =PaPoetapae apeso,apeednis miLn =S a an lyrjc(pNm, pVrin pDpnece, anag C AA.etns L)stig( rsles+ Rsle.r(ScrSca Rpstr" ul"tp/scrs eovr = eovrul"eueoil eoioy, r(ht:/eue oilw/eoioyrlae/)(eovriytlPten) ca.srpstr/eess")Rsle.vSyeatrs ) }
  • 9. Configuration Settings go in a securesocial section of your conf file Global settings: onLoginGoto, onLogoutoTo, ssl scrsca { eueoil oLgnoo/ noiGT= oLguGT=lgn nootoo/oi slfle s=as }
  • 10. Configuration Username Password Provider ueps { sras wtUeNmSpotfle ihsraeupr=as snWloemi=re edecmEaltu ealGaaaSpottu nbervtrupr=re tknuain6 oeDrto=0 tkneeenevl5 oeDltItra= ealTkno=re nbeoeJbtu hse=cyt ahrbrp mnmmasodegh8 iiuPswrLnt= }
  • 11. Configuration OAuth 1 and OAuth 2 based providers titr{ wte rqetoeUl"tp:/wte.o/at/eus_oe" eusTknr=hts/titrcmouhrqettkn acsTknr=hts/titrcmouhacs_oe" cesoeUl"tp:/wte.o/at/cestkn atoiainr=hts/titrcmouhatetct" uhrztoUl"tp:/wte.o/at/uhniae cnueKyyu_osmrky osmre=orcnue_e cnueSce=orcnue_ert osmrertyu_osmrsce } fcbo { aeok atoiainr=hts/gahfcbo.o/at/uhrz" uhrztoUl"tp:/rp.aeokcmouhatoie acsTknr=hts/gahfcbo.o/at/cestkn cesoeUl"tp:/rp.aeokcmouhacs_oe" cinI=orcin_d letdyu_leti cinSce=orcin_ert letertyu_letsce soeeal cp=mi }
  • 12. Protecting Actions SecuredAction: intercepts requests and redirects them to a login page if the user is not authenticated (returns unauthorized error for ajax calls) Authorization: SecuredActions can receive an Authorization instance that checks if an authenticated user is authorized to execute it. Renders an error page (returns forbidden for ajax calls)
  • 13. SecuredAction Add the SecureSocial trait to your controllers dfmAto =Scrdcin{ipii rqet= e ycin eueAto mlct eus > O(iw.tlidxrqetue) kveshm.ne(eus.sr) } dfmAaCl =Scrdcintu){ipii rqet= e yjxal eueAto(re mlct eus > O(sntJo(a(msae - "el").sJO) kJo.osnMp"esg" > hlo))a(SN }
  • 14. Authorization To add authorization logic to an action you need to implement the Authorization trait. cs casWtRl(oe Rl)etnsAtoiain{ ae ls ihoerl: oe xed uhrzto dfiAtoie(dniy Iett) Boen={ e suhrzdiett: dniy: ola iett mth{ dniy ac cs ue:Ue = ue.aRl(oe ae sr sr > srhsoerl) cs _= ae > Lge.ro(DdntgtaSsinsrojc" ogrerr"i o e esoUe bet) fle as } } } dfmAto =Scrdcin WtRl(di)){ipii rqet= e ycin eueAto( ihoeAmn mlct eus > O(iw.tlidxrqetue) kveshm.ne(eus.sr) }
  • 15. UsernamePassword Provider Enforces flows that prevent leaking information in the Signup, Login and Password recovery flows Password change functionality Enforces password strength and hashing
  • 16. Password Validator Used to enforce password strength DefaultPasswordValidator: checks length specified in settings file To customize, implement the PasswordValidator and register it in the play.plugins file tatPswrVldtretnsPui { ri asodaiao xed lgn dfiVldpswr:Srn) Boen e sai(asod tig: ola dferresg:Srn e roMsae tig }
  • 17. Password Hasher Built in (and recommended) is based on Bcrypt Several can be configured, allowing easy migration to new algorithms as needed PasswordInfo: stores the hashed password, an optional salt and the hasher id Passwords are hashed with the 'default' hasher tatPswrHse etnsPui wt Rgsrbe{ ri asodahr xed lgn ih eital dfhs(liPswr:Srn) PswrIf e ahpanasod tig: asodno dfmthspswrIf:PswrIf,splePswr:Srn) Boen e ace(asodno asodno upidasod tig: ola }
  • 18. Views Customization Built in templates use Twitter Bootstrap TemplatesPlugin: used to render views/emails To customize: change css or implement and register it instead of the default one dfgtoiPg[]ipii rqet RqetA, e eLgnaeA(mlct eus: eus[] fr:Fr[Srn,Srn), om om(tig tig] mg Oto[tig =Nn) Hm s: pinSrn] oe: tl dfgtinpmi(oe:Srn)ipii rqet Rqetedr:Srn e eSgUEaltkn tig(mlct eus: eusHae) tig dfgtoiPg[]ipii rqet RqetA, e eLgnaeA(mlct eus: eus[] fr:Fr[Srn,Srn), om om(tig tig] mg Oto[tig =Nn) Hm = s: pinSrn] oe: tl { scrsca.iw.tllgnfr,mg eueoilveshm.oi(om s) } dfgtinpmi(oe:Srn)ipii rqet Rqetedr:Srn ={ e eSgUEaltkn tig(mlct eus: eusHae) tig scrsca.iw.tlmissgUEaltkn.oy eueoilveshm.al.inpmi(oe)bd }
  • 19. Internationalization Built in messages are extracted To customize: copy the messages from the sources into your messages file and change as needed scrsca.oi.il=oi eueoillgntteLgn scrsca.oi.eehr eueoillgnhr=ee scrsca.oi.naiCeetasIvldCeetas eueoillgnivldrdnil=nai rdnil scrsca.oi.ogtasodDdyufre yu pswr? eueoillgnfroPswr=i o ogt or asod
  • 20. Creating an Identity Provider asrc casIettPoie(plcto:Apiain btat ls dniyrvdrapiain plcto) etnsPui wt Rgsrbe xed lgn ih eital { . . dfdAt[])ipii rqet RqetA)Ete[eut ScaUe] e ouhA((mlct eus: eus[]:ihrRsl, oilsr dfflPoieue:ScaUe)ScaUe e ilrfl(sr oilsr:oilsr . . }
  • 21. What's next OpenID support More providers (eg:Foursquare, Wordpress, Yahoo). Account linking support
  • 23. Q&A
  • 24. Links Project site: http://www.securesocial.ws GitHub: https://github.com/jaliss/securesocial