SlideShare a Scribd company logo
1 of 51
YOUR (RAILS) APP ON
THE GOOGLE APPS
MARKETPLACE
Lessons learned from integrating
Fraudpointer
Should I be interested?
   Scenario 1 :
     You are a SaaS vendor
     Your application is organization oriented (users
      belong to groups / organizations)

   Scenario 2 (with some constraints / changes) :
       Same as 1 but user oriented

   Scenario 3 :
     Your organization is using Google Apps
     You have custom applications with “admin” sections
Presentation Outline
   What is Google Apps ™ / Marketplace
   What is Fraudpointer / Fraudpointer integration
    points
   Bootstrapping
   Dev environment
   Integrating
   Gotchas
   Further work
   Resources
   Acknowledgements
   Q/A
Google Apps Marketplace
   Google *what*?
Google Apps Marketplace

    Thousands of
     applications
     that integrate
     with Google
     Apps accounts
    You
     search, pick, ad
     d and use
    Payment either
     transparent
     through the
     Marketplace or
     independently
     through the
     Vendors
Google Apps Marketplace
   Applications added to your Google Apps
    account are added organization-wide
   Applications added to your Google Apps
    account gain restricted access to your Google
    user’s data
   Only admins can add new applications
Google Apps Marketplace

    As a vendor you sell your own applications
Benefits
   Organization perspective :
     Streamlined   experience
     Integration with existing tools

     Zero friction setup (hopefully)



   Vendor perspective
     New  marketing channel
     Easier sign-ups / conversions

     Customer happiness!
Google Apps Marketplace
Integration points
   Required
     SingleSign On
     Universal navigation



   Optional
     Provisioning

     DataAPIs
     Gmail contextual gadgets
Fraudpointer
   Fraud prevention platform
       Credit card fraud
       Account phising
       Digital rights misuse
       …
   SaaS
   A tool to be used alongside existing “enterprise” tools
    like
       E-Commerce platform
       CRM
       ERP
       Productivity / communication tools (Google Apps!)
Fraudpointer
   Major components
     Account setup & configuration
     Fraud Assessment API

     Rule Engine

     Reputation Database

     Case Management

    …
Fraudpointer Integration
   Major components
     Account  setup & configuration
     Fraud Assessment API

     Rule Engine

     Reputation Database

     Case Management

    …
Fraudpointer Integration
   One click account creation & setup
   Single Sign On
   Gmail & Contacts integration
   Rule engine lists management from Google
    Spreadsheets
   Cases exporting to Google Spreadsheets
Fraudpointer Integration
   One click account creation & setup
       Provisioning API (Read)
   Single Sign On
       OAuth
   Gmail & Contacts integration
       Gmail API (Read/Write/Send)
       Contacts API (Read)
   Rule engine lists management from Google Spreadsheets
       Spreadsheets API (Read/Write)
       Docs API (Read/ Write)
   Cases exporting to Google Spreadsheets
       Spreadsheets API (Read/Write)
       Docs API (Read/Write)
Bootstrapping
   Google Apps account
   Not a @gmail one – a custom domain one!
   Free or paid
   Permissions to install applications on your
    Google Apps domain (needed during
    development)
Act as a vendor

    You will act as
     a Vendor,
     selling your
     application
    This is true
     both for live /
     development
     phase
    GOTCHA :
     Vendor
     profiles “per
     user”. Not “per
     domain”
Add a listing

    Create a new listing in your Vendor profile
    This is what you are selling
Listing details




    Application manifest is the most important thing
    Listing manifest is not required!
Application Manifest
   Best practices
     Declare the various API scopes in your code
     Automatically generate the URLs from Rails
      helpers
     Copy-paste the generated xml to the listing


   Gotchas
     Watch   out for whitespaces & blank lines
      before/after the actual XML!
     Totally stupid listing form with totally stupid
      validation errors!
Listing save & preview

    Save & preview without fear – nobody will
     see
    Ignore the Analytics id and the Google APIs
Add it to start development!

   Don’t submit
   Just “Add it
    now”
   This is your
    development
    installation
   This is the
    same
    experience your
    users will have!
Addition is a 2-phase process

   When “agree”
    is pressed
    application is
    “added”
   No access to
    data yet!
   No
    configuration
    yet!
Addition is a 2-phase process
   Granting data
    access
   Read from the
    application manifest
Setup/Configuration (optional)
   Application has access
   Knows nothing (yet) about it’s addition though!
   This is where you “hook” and bootstrap the
    account!
Setup/Configuration (optional)
   The Google Apps admin sees a configuration
    screen
   Selects users / groups to import
   Configures other account settings

   The alternative is to import all Google Apps
    users (ouch!)
Successful addition
Successful addition
Development environment
   Hack your hosts so redirects / URLs are not
    “localhost”!
   Get a Google Apps account!
   One “installation” per developer (doesn’t scale
    really…)
Single Sign On
   Required integration point
   Based on OpenID
   Google is an OpenID Identity Provider via the OpenID
    Federated Login Service
   Fraudpointer acts as an OpenID Relying Party
   Google’s OpenID implementation :
    http://code.google.com/googleapps/domain/sso/openid_refer
    ence_implementation.html
   With Federated Login enabled, Google Apps users
    authenticate with OpenID to Fraudpointer
   Attention to the Discovery Mechanism :
    https://sites.google.com/site/oauthgoog/fedlogininterp/openid
    discovery
OpenID Authentication

    Proves an end user “controls” an “identifier”
        Simply put : one account – login to multiple sites!
    Relying Party doesn’t require access to end
     user credentials (such as password)
    User just types one piece of information (such
     as OpenID identifier)
OpenID authentication flow
OpenID Authentication
   Read guidelines for UI
   Use an existing library!
   Ruby has ruby-openid
     https://github.com/openid/ruby-openid

     Both for Relying Party & Provider
     BTW, Fraudpointer does not use it directly and
      neither should you!
Single Sign On
   *Should* work out of the box with :
     rack-openid
       HTTPish API around ruby-openid
       Uses ruby-openid internally

     ruby-openid-apps-discovery
       Support   for Google’s discovery mechanism
Single Sign On
require 'gapps_openid' # ....this is from ruby-openid-apps-discovery
require 'rack/openid' # ....this is from rack-openid
# ... inside the method that handles your login ...
# you essentially respond with requirement to authenticate
# since the user is considered unauthorized. You also provide
# a callback URL and method so that when authentication ends
# you take back the control. Discovery and the whole authentication
# process is transparent to your code. You do not have to do anything
# more than this.
#
headers['WWW-Authenticate'] = Rack::OpenID.build_header(
        :identifier => options[:open_id],
        :required => ["http://axschema.org/contact/email",
                   "http://axschema.org/namePerson/first",
                   "http://axschema.org/namePerson/last"],
        :return_to => url_for(options[:return_to_options]),
        :method => options[:return_to_method]
)
render :nothing => true, :status => :unauthorized
Single Sign On
request.env["rack.openid.response"]

will have information about the success or failure of the
authentication.
1st make sure that nothing of the following is false
params[:open_id].blank? ||
request.env["rack.openid.response"].nil? ||
request.env["rack.openid.response"].status != :success

If everything ok, then you can be sure that user has
been authenticated and you can get his data and
redirect to your home page:
ax = OpenID::AX::FetchResponse.from_success_response(request.env["rack.openid.response"])
@email = ax.get_single("http://axschema.org/contact/email")
@first_name = ax.get_single("http://axschema.org/namePerson/first")
@last_name = ax.get_single("http://axschema.org/namePerson/last")
Authorization

    oauth
    two-legged-oauth
    Fraudpointer is a “consumer”
Authorization
   “two legged oauth”???
Access to Google Data APIs
   2-legged Oauth is the source of the biggest
    confusion!
   On normal situations (no Google Apps) :
    A  Google user (username@gmail.com) grants
      access to a 3rd party application (freemium-
      sass.com) for their data
     3rd party application can now access this user’s
      data
   So for example, freemium-saas has access to
    all of the user’s Google Documents
Access to Google Data APIs
   On Google Apps situation is different

   A Google Apps domain administrator grants access
    for the all the domain’s users data to a 3rd party
    application (enterprise-saas.com)
   3rd party application plays the role of the currently
    logged in user by sending the identity of the user
    (xoauth_requestor_id)
   The current instance of the 3rd party application has
    same access to data as the requesting user would
    have
   The real user has no way of restraining access to his
    data for this app (only the admin)
Access to Google Data APIs
   Normal requests to Google Data APIs are like
    this :
    https://docs.google.com/feeds/user@yourdom
    ain.com/private/full/

   But for Google Apps using 2-legged Oauth it
    becomes this :
    https://docs.google.com/feeds/user@yourdom
    ain.com/private/full?xoauth_requestor_id=ad
    min@yourdomain.com
two-legged-oauth gem
   Transparent hack for all Ruby Google APIs
    libraries with OAuth support
   Rewriting on the fly the URLs so that it contains
    the magic “xoauth_requestor_id” parameter

   Ugly but seems to work so far (thus the 0.0.2
    version)
   @!#$!@#$%%#$@ (yeah a lot of yelling, crying
    and bleeding because of this)
   Feel free to improve it!
Authorization (using the libs)
   Create OAuth::Consumer with key and secret
   Request (on Consumer) a request token
   Request (on Request Token) an access token
   On access token give as parameter the API
    resource you want to access
   Resource should be included in the manifest
Authorization and access
consumer = OAuth::Consumer.new(
   Settings.google_apps.consumer_key,
   Settings.google_apps.consumer_key_secret)
OAuth::TwoLeggedAccessToken.new(consumer, self.email)

GoogleContactsApi::User.new(google_apps_access_token).con
tacts
Authorization - Scopes
   Data access to Google requires correct
    Scopes
   Scopes correspond to Google APIs
   Examples :
     Contacts  API : https://www.google.com/m8/feeds/
     Spreadsheets API :
      https://spreadsheets.google.com/feeds/
   Some resources are “read only”
Existing Ruby libraries
   Provisioning
     {SingleSign On}
     two-legged-oauth

     _our custom not-ready-for-prime-time library_
Existing Ruby Libraries
   Gmail
     {Single   Sign On}
     gmail
     gmail_xoauth


Plus :
 Contacts
     {SingleSign On}
     two-legged-oauth
     google_contacts_api
Existing Ruby Libraries
   Spreadsheets
     {SingleSign On}
     two-legged-oauth

     google-spreadsheet-ruby
User Experience

    Search and find the application in the
     marketplace
    Watch for the icons!
Gotchas
   No official Google support for Ruby 
   Sparse documentation #@$@#$^&
   Development environment doesn’t scale for
    big teams
Further work
   Google Apps Marketplace meta-gem
     Containing  all gems that are required
     Proper instructions (!!!)

   Merge various patches to official gem repos
   Better documentation
Q/A
   Ask ask ask!

   In any case :
     Fraudpointer   : support at fraudpointer.com
     Authors   :
       n.dimitrakopoulosat fraudpointer.com
       p.matsinopoulos at fraudpointer.com

More Related Content

What's hot

Accessible Form Hints and Errors
Accessible Form Hints and ErrorsAccessible Form Hints and Errors
Accessible Form Hints and ErrorsRuss Weakley
 
Microsoft identity platform developer community call-October 2019
Microsoft identity platform developer community call-October 2019Microsoft identity platform developer community call-October 2019
Microsoft identity platform developer community call-October 2019Microsoft 365 Developer
 
Hi5 Hackathon Presentation
Hi5 Hackathon PresentationHi5 Hackathon Presentation
Hi5 Hackathon PresentationLou Moore
 
Intro to API Security with Oauth 2.0
Intro to API Security with Oauth 2.0Intro to API Security with Oauth 2.0
Intro to API Security with Oauth 2.0Functional Imperative
 
24032022 Zero Trust for Developers Pub.pdf
24032022 Zero Trust for Developers Pub.pdf24032022 Zero Trust for Developers Pub.pdf
24032022 Zero Trust for Developers Pub.pdfTomasz Kopacz
 
Linkedin & OAuth
Linkedin & OAuthLinkedin & OAuth
Linkedin & OAuthUmang Goyal
 
Claims-Based Identity in SharePoint 2010
Claims-Based Identity in SharePoint 2010Claims-Based Identity in SharePoint 2010
Claims-Based Identity in SharePoint 2010Danny Jessee
 
LinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroLinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroTaylor Singletary
 
Creating accessible modals and autocompletes
Creating accessible modals and autocompletesCreating accessible modals and autocompletes
Creating accessible modals and autocompletesRuss Weakley
 
Import google contacts with php or javascript using google contacts api and o...
Import google contacts with php or javascript using google contacts api and o...Import google contacts with php or javascript using google contacts api and o...
Import google contacts with php or javascript using google contacts api and o...Design 19
 
SharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the CloudSharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the CloudDanny Jessee
 
DevCon 2010 - Facebook Apps development for ASP.NET devs
DevCon 2010 - Facebook Apps development  for ASP.NET devsDevCon 2010 - Facebook Apps development  for ASP.NET devs
DevCon 2010 - Facebook Apps development for ASP.NET devsKrishna T
 
SharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the CloudSharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the CloudDanny Jessee
 
Claims-Based Identity, Facebook, and the Cloud
Claims-Based Identity, Facebook, and the CloudClaims-Based Identity, Facebook, and the Cloud
Claims-Based Identity, Facebook, and the CloudDanny Jessee
 
SharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the CloudSharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the CloudDanny Jessee
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidAlberto Ruibal
 

What's hot (20)

Accessible Form Hints and Errors
Accessible Form Hints and ErrorsAccessible Form Hints and Errors
Accessible Form Hints and Errors
 
Microsoft identity platform developer community call-October 2019
Microsoft identity platform developer community call-October 2019Microsoft identity platform developer community call-October 2019
Microsoft identity platform developer community call-October 2019
 
Hi5 Hackathon Presentation
Hi5 Hackathon PresentationHi5 Hackathon Presentation
Hi5 Hackathon Presentation
 
Intro to API Security with Oauth 2.0
Intro to API Security with Oauth 2.0Intro to API Security with Oauth 2.0
Intro to API Security with Oauth 2.0
 
24032022 Zero Trust for Developers Pub.pdf
24032022 Zero Trust for Developers Pub.pdf24032022 Zero Trust for Developers Pub.pdf
24032022 Zero Trust for Developers Pub.pdf
 
Linkedin & OAuth
Linkedin & OAuthLinkedin & OAuth
Linkedin & OAuth
 
Claims-Based Identity in SharePoint 2010
Claims-Based Identity in SharePoint 2010Claims-Based Identity in SharePoint 2010
Claims-Based Identity in SharePoint 2010
 
LinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroLinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To Hero
 
Creating accessible modals and autocompletes
Creating accessible modals and autocompletesCreating accessible modals and autocompletes
Creating accessible modals and autocompletes
 
Import google contacts with php or javascript using google contacts api and o...
Import google contacts with php or javascript using google contacts api and o...Import google contacts with php or javascript using google contacts api and o...
Import google contacts with php or javascript using google contacts api and o...
 
OAuth2 and LinkedIn
OAuth2 and LinkedInOAuth2 and LinkedIn
OAuth2 and LinkedIn
 
OAuth 2 Presentation
OAuth 2 PresentationOAuth 2 Presentation
OAuth 2 Presentation
 
SharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the CloudSharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
 
DevCon 2010 - Facebook Apps development for ASP.NET devs
DevCon 2010 - Facebook Apps development  for ASP.NET devsDevCon 2010 - Facebook Apps development  for ASP.NET devs
DevCon 2010 - Facebook Apps development for ASP.NET devs
 
Android Programming.pptx
Android Programming.pptxAndroid Programming.pptx
Android Programming.pptx
 
SharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the CloudSharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
 
Claims-Based Identity, Facebook, and the Cloud
Claims-Based Identity, Facebook, and the CloudClaims-Based Identity, Facebook, and the Cloud
Claims-Based Identity, Facebook, and the Cloud
 
SharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the CloudSharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
SharePoint 2010, Claims-Based Identity, Facebook, and the Cloud
 
Android Layout.pptx
Android Layout.pptxAndroid Layout.pptx
Android Layout.pptx
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
 

Viewers also liked

Meaningful connections 05142013
Meaningful connections  05142013Meaningful connections  05142013
Meaningful connections 05142013RBOA_PR
 
The Art of Social Media - Digital Strategy
The Art of Social Media - Digital StrategyThe Art of Social Media - Digital Strategy
The Art of Social Media - Digital StrategyRBOA_PR
 
CTXAUG Slides from 20 July 2011 Meetup
CTXAUG Slides from 20 July 2011 MeetupCTXAUG Slides from 20 July 2011 Meetup
CTXAUG Slides from 20 July 2011 Meetupctxaug
 
Regenstein Reference Desk Show
Regenstein Reference Desk ShowRegenstein Reference Desk Show
Regenstein Reference Desk ShowJohn Kimbrough
 
Public relations 2.0
Public relations 2.0Public relations 2.0
Public relations 2.0RBOA_PR
 
Autenticazione in ambito REST
Autenticazione in ambito RESTAutenticazione in ambito REST
Autenticazione in ambito RESTsorrenro
 
How Configure Visitor Tracking Gadget
How Configure Visitor Tracking GadgetHow Configure Visitor Tracking Gadget
How Configure Visitor Tracking Gadgetguest2be90f
 
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity APIBuilding SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity APISharePointRadi
 
Mediating Mature Services, ESBs and APIs: Lessons Learned from Five Years of ...
Mediating Mature Services, ESBs and APIs: Lessons Learned from Five Years of ...Mediating Mature Services, ESBs and APIs: Lessons Learned from Five Years of ...
Mediating Mature Services, ESBs and APIs: Lessons Learned from Five Years of ...CA Technologies
 
Securing your API Portfolio with API Management
Securing your API Portfolio with API ManagementSecuring your API Portfolio with API Management
Securing your API Portfolio with API ManagementCA Technologies
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring SecurityOrest Ivasiv
 
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache OltuOAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache OltuAntonio Sanso
 
JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2Rodrigo Cândido da Silva
 
[SDX2016] 2016年 SEO 的關鍵在 UX / 連啓佑 將能數位行銷 執行長
[SDX2016] 2016年 SEO 的關鍵在 UX / 連啓佑 將能數位行銷 執行長[SDX2016] 2016年 SEO 的關鍵在 UX / 連啓佑 將能數位行銷 執行長
[SDX2016] 2016年 SEO 的關鍵在 UX / 連啓佑 將能數位行銷 執行長悠識學院
 
App行銷推廣與行動行銷策略經營2015 PDF版
App行銷推廣與行動行銷策略經營2015 PDF版App行銷推廣與行動行銷策略經營2015 PDF版
App行銷推廣與行動行銷策略經營2015 PDF版jackylee0527
 
Seo 最重要的檢查項目
Seo 最重要的檢查項目Seo 最重要的檢查項目
Seo 最重要的檢查項目Gene Hong
 

Viewers also liked (19)

Prueva 2
Prueva 2Prueva 2
Prueva 2
 
Meaningful connections 05142013
Meaningful connections  05142013Meaningful connections  05142013
Meaningful connections 05142013
 
The Art of Social Media - Digital Strategy
The Art of Social Media - Digital StrategyThe Art of Social Media - Digital Strategy
The Art of Social Media - Digital Strategy
 
CTXAUG Slides from 20 July 2011 Meetup
CTXAUG Slides from 20 July 2011 MeetupCTXAUG Slides from 20 July 2011 Meetup
CTXAUG Slides from 20 July 2011 Meetup
 
Regenstein Reference Desk Show
Regenstein Reference Desk ShowRegenstein Reference Desk Show
Regenstein Reference Desk Show
 
Public relations 2.0
Public relations 2.0Public relations 2.0
Public relations 2.0
 
Autenticazione in ambito REST
Autenticazione in ambito RESTAutenticazione in ambito REST
Autenticazione in ambito REST
 
How Configure Visitor Tracking Gadget
How Configure Visitor Tracking GadgetHow Configure Visitor Tracking Gadget
How Configure Visitor Tracking Gadget
 
Api security
Api security Api security
Api security
 
Oauth2.0
Oauth2.0Oauth2.0
Oauth2.0
 
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity APIBuilding SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
 
Mediating Mature Services, ESBs and APIs: Lessons Learned from Five Years of ...
Mediating Mature Services, ESBs and APIs: Lessons Learned from Five Years of ...Mediating Mature Services, ESBs and APIs: Lessons Learned from Five Years of ...
Mediating Mature Services, ESBs and APIs: Lessons Learned from Five Years of ...
 
Securing your API Portfolio with API Management
Securing your API Portfolio with API ManagementSecuring your API Portfolio with API Management
Securing your API Portfolio with API Management
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring Security
 
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache OltuOAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
 
JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2JavaOne 2014 - Securing RESTful Resources with OAuth2
JavaOne 2014 - Securing RESTful Resources with OAuth2
 
[SDX2016] 2016年 SEO 的關鍵在 UX / 連啓佑 將能數位行銷 執行長
[SDX2016] 2016年 SEO 的關鍵在 UX / 連啓佑 將能數位行銷 執行長[SDX2016] 2016年 SEO 的關鍵在 UX / 連啓佑 將能數位行銷 執行長
[SDX2016] 2016年 SEO 的關鍵在 UX / 連啓佑 將能數位行銷 執行長
 
App行銷推廣與行動行銷策略經營2015 PDF版
App行銷推廣與行動行銷策略經營2015 PDF版App行銷推廣與行動行銷策略經營2015 PDF版
App行銷推廣與行動行銷策略經營2015 PDF版
 
Seo 最重要的檢查項目
Seo 最重要的檢查項目Seo 最重要的檢查項目
Seo 最重要的檢查項目
 

Similar to Fraudpointer - Google Apps integration

APIs: the Glue of Cloud Computing
APIs: the Glue of Cloud ComputingAPIs: the Glue of Cloud Computing
APIs: the Glue of Cloud Computing3scale
 
Flutter Android / iOS Build Preparation
Flutter Android / iOS Build PreparationFlutter Android / iOS Build Preparation
Flutter Android / iOS Build Preparation9 series
 
App Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and AppApp Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and AppJuan Gomez
 
LA2M Google Tools Presentation Apr 1st 09
LA2M Google Tools Presentation Apr 1st 09LA2M Google Tools Presentation Apr 1st 09
LA2M Google Tools Presentation Apr 1st 09oneilldec
 
iPhone first App Store submission
iPhone  first App Store submissioniPhone  first App Store submission
iPhone first App Store submissionPragati Singh
 
App Model For SharePoint 2013
App Model For SharePoint 2013App Model For SharePoint 2013
App Model For SharePoint 2013Toni Il Caiser
 
Azure AD for browser-based application developers
Azure AD for browser-based application developersAzure AD for browser-based application developers
Azure AD for browser-based application developersBob German
 
Get a 360° View From Your Apptivo CRM
Get a 360° View From Your Apptivo CRMGet a 360° View From Your Apptivo CRM
Get a 360° View From Your Apptivo CRMApptivo
 
Getting Started With Apptivo CRM Software
Getting Started With Apptivo CRM SoftwareGetting Started With Apptivo CRM Software
Getting Started With Apptivo CRM SoftwareApptivo
 
SharePoint 2013 Apps and the App Model
SharePoint 2013 Apps and the App ModelSharePoint 2013 Apps and the App Model
SharePoint 2013 Apps and the App ModelJames Tramel
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Developmentsonichinmay
 
The Nitty Gritty of Affiliate Marketing Compliance
The Nitty Gritty of Affiliate Marketing ComplianceThe Nitty Gritty of Affiliate Marketing Compliance
The Nitty Gritty of Affiliate Marketing ComplianceAffiliate Summit
 
Guide To API Development.pdf
Guide To API Development.pdfGuide To API Development.pdf
Guide To API Development.pdfTechugo
 
How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...
How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...
How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...Techugo Inc
 
Confessions of-a-gadget-holic
Confessions of-a-gadget-holicConfessions of-a-gadget-holic
Confessions of-a-gadget-holicTyrell Perera
 
How to register your application to authorize o365 graph api
How to register your application to authorize o365 graph apiHow to register your application to authorize o365 graph api
How to register your application to authorize o365 graph apiRakesh SHarma
 
Outils affilies en
Outils affilies enOutils affilies en
Outils affilies enEffiliation
 
Dev day paris020415
Dev day paris020415Dev day paris020415
Dev day paris020415pdufourSFDC
 

Similar to Fraudpointer - Google Apps integration (20)

APIs: the Glue of Cloud Computing
APIs: the Glue of Cloud ComputingAPIs: the Glue of Cloud Computing
APIs: the Glue of Cloud Computing
 
Flutter Android / iOS Build Preparation
Flutter Android / iOS Build PreparationFlutter Android / iOS Build Preparation
Flutter Android / iOS Build Preparation
 
App Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and AppApp Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and App
 
LA2M Google Tools Presentation Apr 1st 09
LA2M Google Tools Presentation Apr 1st 09LA2M Google Tools Presentation Apr 1st 09
LA2M Google Tools Presentation Apr 1st 09
 
iPhone first App Store submission
iPhone  first App Store submissioniPhone  first App Store submission
iPhone first App Store submission
 
App Model For SharePoint 2013
App Model For SharePoint 2013App Model For SharePoint 2013
App Model For SharePoint 2013
 
Azure AD for browser-based application developers
Azure AD for browser-based application developersAzure AD for browser-based application developers
Azure AD for browser-based application developers
 
Point of Sale.pptx
Point of Sale.pptxPoint of Sale.pptx
Point of Sale.pptx
 
Get a 360° View From Your Apptivo CRM
Get a 360° View From Your Apptivo CRMGet a 360° View From Your Apptivo CRM
Get a 360° View From Your Apptivo CRM
 
Getting Started With Apptivo CRM Software
Getting Started With Apptivo CRM SoftwareGetting Started With Apptivo CRM Software
Getting Started With Apptivo CRM Software
 
SharePoint 2013 Apps and the App Model
SharePoint 2013 Apps and the App ModelSharePoint 2013 Apps and the App Model
SharePoint 2013 Apps and the App Model
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Development
 
The Nitty Gritty of Affiliate Marketing Compliance
The Nitty Gritty of Affiliate Marketing ComplianceThe Nitty Gritty of Affiliate Marketing Compliance
The Nitty Gritty of Affiliate Marketing Compliance
 
Guide To API Development.pdf
Guide To API Development.pdfGuide To API Development.pdf
Guide To API Development.pdf
 
How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...
How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...
How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...
 
Confessions of-a-gadget-holic
Confessions of-a-gadget-holicConfessions of-a-gadget-holic
Confessions of-a-gadget-holic
 
How to register your application to authorize o365 graph api
How to register your application to authorize o365 graph apiHow to register your application to authorize o365 graph api
How to register your application to authorize o365 graph api
 
Outils affilies en
Outils affilies enOutils affilies en
Outils affilies en
 
API.docx
API.docxAPI.docx
API.docx
 
Dev day paris020415
Dev day paris020415Dev day paris020415
Dev day paris020415
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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
 
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
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
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)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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)
 
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
 
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...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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...
 
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
 

Fraudpointer - Google Apps integration

  • 1. YOUR (RAILS) APP ON THE GOOGLE APPS MARKETPLACE Lessons learned from integrating Fraudpointer
  • 2. Should I be interested?  Scenario 1 :  You are a SaaS vendor  Your application is organization oriented (users belong to groups / organizations)  Scenario 2 (with some constraints / changes) :  Same as 1 but user oriented  Scenario 3 :  Your organization is using Google Apps  You have custom applications with “admin” sections
  • 3. Presentation Outline  What is Google Apps ™ / Marketplace  What is Fraudpointer / Fraudpointer integration points  Bootstrapping  Dev environment  Integrating  Gotchas  Further work  Resources  Acknowledgements  Q/A
  • 5. Google Apps Marketplace  Thousands of applications that integrate with Google Apps accounts  You search, pick, ad d and use  Payment either transparent through the Marketplace or independently through the Vendors
  • 6. Google Apps Marketplace  Applications added to your Google Apps account are added organization-wide  Applications added to your Google Apps account gain restricted access to your Google user’s data  Only admins can add new applications
  • 7. Google Apps Marketplace  As a vendor you sell your own applications
  • 8. Benefits  Organization perspective :  Streamlined experience  Integration with existing tools  Zero friction setup (hopefully)  Vendor perspective  New marketing channel  Easier sign-ups / conversions  Customer happiness!
  • 9. Google Apps Marketplace Integration points  Required  SingleSign On  Universal navigation  Optional  Provisioning  DataAPIs  Gmail contextual gadgets
  • 10. Fraudpointer  Fraud prevention platform  Credit card fraud  Account phising  Digital rights misuse  …  SaaS  A tool to be used alongside existing “enterprise” tools like  E-Commerce platform  CRM  ERP  Productivity / communication tools (Google Apps!)
  • 11. Fraudpointer  Major components  Account setup & configuration  Fraud Assessment API  Rule Engine  Reputation Database  Case Management …
  • 12. Fraudpointer Integration  Major components  Account setup & configuration  Fraud Assessment API  Rule Engine  Reputation Database  Case Management …
  • 13. Fraudpointer Integration  One click account creation & setup  Single Sign On  Gmail & Contacts integration  Rule engine lists management from Google Spreadsheets  Cases exporting to Google Spreadsheets
  • 14. Fraudpointer Integration  One click account creation & setup  Provisioning API (Read)  Single Sign On  OAuth  Gmail & Contacts integration  Gmail API (Read/Write/Send)  Contacts API (Read)  Rule engine lists management from Google Spreadsheets  Spreadsheets API (Read/Write)  Docs API (Read/ Write)  Cases exporting to Google Spreadsheets  Spreadsheets API (Read/Write)  Docs API (Read/Write)
  • 15. Bootstrapping  Google Apps account  Not a @gmail one – a custom domain one!  Free or paid  Permissions to install applications on your Google Apps domain (needed during development)
  • 16. Act as a vendor  You will act as a Vendor, selling your application  This is true both for live / development phase  GOTCHA : Vendor profiles “per user”. Not “per domain”
  • 17. Add a listing  Create a new listing in your Vendor profile  This is what you are selling
  • 18. Listing details  Application manifest is the most important thing  Listing manifest is not required!
  • 19. Application Manifest  Best practices  Declare the various API scopes in your code  Automatically generate the URLs from Rails helpers  Copy-paste the generated xml to the listing  Gotchas  Watch out for whitespaces & blank lines before/after the actual XML!  Totally stupid listing form with totally stupid validation errors!
  • 20. Listing save & preview  Save & preview without fear – nobody will see  Ignore the Analytics id and the Google APIs
  • 21. Add it to start development!  Don’t submit  Just “Add it now”  This is your development installation  This is the same experience your users will have!
  • 22. Addition is a 2-phase process  When “agree” is pressed application is “added”  No access to data yet!  No configuration yet!
  • 23. Addition is a 2-phase process  Granting data access  Read from the application manifest
  • 24. Setup/Configuration (optional)  Application has access  Knows nothing (yet) about it’s addition though!  This is where you “hook” and bootstrap the account!
  • 25. Setup/Configuration (optional)  The Google Apps admin sees a configuration screen  Selects users / groups to import  Configures other account settings  The alternative is to import all Google Apps users (ouch!)
  • 28. Development environment  Hack your hosts so redirects / URLs are not “localhost”!  Get a Google Apps account!  One “installation” per developer (doesn’t scale really…)
  • 29. Single Sign On  Required integration point  Based on OpenID  Google is an OpenID Identity Provider via the OpenID Federated Login Service  Fraudpointer acts as an OpenID Relying Party  Google’s OpenID implementation : http://code.google.com/googleapps/domain/sso/openid_refer ence_implementation.html  With Federated Login enabled, Google Apps users authenticate with OpenID to Fraudpointer  Attention to the Discovery Mechanism : https://sites.google.com/site/oauthgoog/fedlogininterp/openid discovery
  • 30. OpenID Authentication  Proves an end user “controls” an “identifier”  Simply put : one account – login to multiple sites!  Relying Party doesn’t require access to end user credentials (such as password)  User just types one piece of information (such as OpenID identifier)
  • 32. OpenID Authentication  Read guidelines for UI  Use an existing library!  Ruby has ruby-openid  https://github.com/openid/ruby-openid  Both for Relying Party & Provider  BTW, Fraudpointer does not use it directly and neither should you!
  • 33. Single Sign On  *Should* work out of the box with :  rack-openid  HTTPish API around ruby-openid  Uses ruby-openid internally  ruby-openid-apps-discovery  Support for Google’s discovery mechanism
  • 34. Single Sign On require 'gapps_openid' # ....this is from ruby-openid-apps-discovery require 'rack/openid' # ....this is from rack-openid # ... inside the method that handles your login ... # you essentially respond with requirement to authenticate # since the user is considered unauthorized. You also provide # a callback URL and method so that when authentication ends # you take back the control. Discovery and the whole authentication # process is transparent to your code. You do not have to do anything # more than this. # headers['WWW-Authenticate'] = Rack::OpenID.build_header( :identifier => options[:open_id], :required => ["http://axschema.org/contact/email", "http://axschema.org/namePerson/first", "http://axschema.org/namePerson/last"], :return_to => url_for(options[:return_to_options]), :method => options[:return_to_method] ) render :nothing => true, :status => :unauthorized
  • 35. Single Sign On request.env["rack.openid.response"] will have information about the success or failure of the authentication. 1st make sure that nothing of the following is false params[:open_id].blank? || request.env["rack.openid.response"].nil? || request.env["rack.openid.response"].status != :success If everything ok, then you can be sure that user has been authenticated and you can get his data and redirect to your home page: ax = OpenID::AX::FetchResponse.from_success_response(request.env["rack.openid.response"]) @email = ax.get_single("http://axschema.org/contact/email") @first_name = ax.get_single("http://axschema.org/namePerson/first") @last_name = ax.get_single("http://axschema.org/namePerson/last")
  • 36. Authorization  oauth  two-legged-oauth  Fraudpointer is a “consumer”
  • 37. Authorization  “two legged oauth”???
  • 38. Access to Google Data APIs  2-legged Oauth is the source of the biggest confusion!  On normal situations (no Google Apps) : A Google user (username@gmail.com) grants access to a 3rd party application (freemium- sass.com) for their data  3rd party application can now access this user’s data  So for example, freemium-saas has access to all of the user’s Google Documents
  • 39. Access to Google Data APIs  On Google Apps situation is different  A Google Apps domain administrator grants access for the all the domain’s users data to a 3rd party application (enterprise-saas.com)  3rd party application plays the role of the currently logged in user by sending the identity of the user (xoauth_requestor_id)  The current instance of the 3rd party application has same access to data as the requesting user would have  The real user has no way of restraining access to his data for this app (only the admin)
  • 40. Access to Google Data APIs  Normal requests to Google Data APIs are like this : https://docs.google.com/feeds/user@yourdom ain.com/private/full/  But for Google Apps using 2-legged Oauth it becomes this : https://docs.google.com/feeds/user@yourdom ain.com/private/full?xoauth_requestor_id=ad min@yourdomain.com
  • 41. two-legged-oauth gem  Transparent hack for all Ruby Google APIs libraries with OAuth support  Rewriting on the fly the URLs so that it contains the magic “xoauth_requestor_id” parameter  Ugly but seems to work so far (thus the 0.0.2 version)  @!#$!@#$%%#$@ (yeah a lot of yelling, crying and bleeding because of this)  Feel free to improve it!
  • 42. Authorization (using the libs)  Create OAuth::Consumer with key and secret  Request (on Consumer) a request token  Request (on Request Token) an access token  On access token give as parameter the API resource you want to access  Resource should be included in the manifest
  • 43. Authorization and access consumer = OAuth::Consumer.new( Settings.google_apps.consumer_key, Settings.google_apps.consumer_key_secret) OAuth::TwoLeggedAccessToken.new(consumer, self.email) GoogleContactsApi::User.new(google_apps_access_token).con tacts
  • 44. Authorization - Scopes  Data access to Google requires correct Scopes  Scopes correspond to Google APIs  Examples :  Contacts API : https://www.google.com/m8/feeds/  Spreadsheets API : https://spreadsheets.google.com/feeds/  Some resources are “read only”
  • 45. Existing Ruby libraries  Provisioning  {SingleSign On}  two-legged-oauth  _our custom not-ready-for-prime-time library_
  • 46. Existing Ruby Libraries  Gmail  {Single Sign On}  gmail  gmail_xoauth Plus :  Contacts  {SingleSign On}  two-legged-oauth  google_contacts_api
  • 47. Existing Ruby Libraries  Spreadsheets  {SingleSign On}  two-legged-oauth  google-spreadsheet-ruby
  • 48. User Experience  Search and find the application in the marketplace  Watch for the icons!
  • 49. Gotchas  No official Google support for Ruby   Sparse documentation #@$@#$^&  Development environment doesn’t scale for big teams
  • 50. Further work  Google Apps Marketplace meta-gem  Containing all gems that are required  Proper instructions (!!!)  Merge various patches to official gem repos  Better documentation
  • 51. Q/A  Ask ask ask!  In any case :  Fraudpointer : support at fraudpointer.com  Authors :  n.dimitrakopoulosat fraudpointer.com  p.matsinopoulos at fraudpointer.com