SlideShare a Scribd company logo
agile.open.connectedLost In OAuth?
Learn Velruse And Get Your Life Back! Andrew Mleczko
Wednesday, 3 July 2013
Andrew Mleczko
Python Dev
RedTurtle - Italy - Poland
amleczko@redturtle.it
@amleczko
www.redturtle.it
Andrew Mleczko
Wednesday, 3 July 2013
What is OAuth?
Wednesday, 3 July 2013
“OAuth is an open standard
for authorization.”
wikipedia
Wednesday, 3 July 2013
Lack of anonymity
Lack of market saturation
Phishing
Data misuseBad precedents
Wednesday, 3 July 2013
This talk is not about it!
Wednesday, 3 July 2013
velruse
Wednesday, 3 July 2013
Ben Bangert
@benbangert
https://github.com/bbangert/velruse
http://pythonhosted.org/velruse
Wednesday, 3 July 2013
velruse
Wednesday, 3 July 2013
minimal configuration use
or
as a stand-alone service
pyramid plugin
Wednesday, 3 July 2013
simple request schema
/{provider}/login
Wednesday, 3 July 2013
as a service
[app:velruse]
use = egg:velruse
endpoint = http://example.com/logged_in
provider.facebook.consumer_key = 441361239240193
provider.facebook.consumer_secret = 52ef2618a1999eeec6d9c
provider.facebook.scope = email
...
Wednesday, 3 July 2013
handling login
# sample callback view in flask
@app.route('/logged_in', methods=['POST'])
def login_callback():
# token is stored in the form data
token = request.form['token']
return render_template('result.html', result=token)
# sample callback view in flask
@app.route('/logged_in', methods=['POST'])
def login_callback():
token = request.form['token']
# the request must contain 'format' and 'token' params
payload = {'format': 'json', 'token': token}
# sending a GET request to /auth_info
response = requests.get(request.host_url + 'velruse/auth_info', params=payload)
auth_info = response.json
return render_template('result.html', result=auth_info)
Wednesday, 3 July 2013
as a pyramid plugin
[app:main]
use = egg:myapp
pyramid.includes = velruse.providers.facebook
velruse.facebook.consumer_key = 441361239240193
velruse.facebook.consumer_secret = 52ef2618a1999eeec6d9c
velruse.facebook.scope = email
...
Wednesday, 3 July 2013
handling login
@view_config(
context='velruse.AuthenticationComplete',
renderer='myapp:templates/result.mako',
)
def login_complete_view(request):
context = request.context
result = {
'provider_type': context.provider_type,
'provider_name': context.provider_name,
'profile': context.profile,
'credentials': context.credentials,
}
return {'result': json.dumps(result, indent=4)}
@view_config(
context='velruse.providers.facebook.FacebookAuthenticationComplete',
renderer='myapp:templates/result.mako',
)
def fb_login_complete_view(request):
pass
Wednesday, 3 July 2013
velruse providers
Wednesday, 3 July 2013
Google OAuth2 example
[app:velruse]
use = egg:velruse
endpoint = http://example.com/logged_in
provider.google.consumer_key = 441361239240193
provider.google.consumer_secret = 52ef2618a1999eeec6d9c
Wednesday, 3 July 2013
alfresco example
github.com/RedTurtle/
pyramid_alfresco
[app:main]
use = egg:myapp
pyramid.includes = pyramid_alfresco.oauth
alfresco.consumer_key = 441361239240193
alfresco.consumer_secret = 52ef2618a1999eeec6d9c
Wednesday, 3 July 2013
alfresco example
class AlfrescoProvider(object):
    def login(self, request):
        """Initiate a alfresco login"""
        scope = request.POST.get('scope', self.scope)
        gh_url = flat_url(
            '%s://%s/auth/oauth/versions/2/authorize' % (self.protocol, self.domain),
            scope=scope,
            response_type='code',
            client_id=self.consumer_key,
            redirect_uri=request.route_url(self.callback_route),
            state=state)
        return HTTPFound(location=gh_url)
Wednesday, 3 July 2013
alfresco example
class AlfrescoProvider(object):
...
    def callback(self, request):
        """Process the alfresco redirect"""
        sess_state = request.session.get('state')
        req_state = request.GET.get('state')
        access_url = flat_url('%s://%s/auth/oauth/versions/2/token' % (self.protocol, self.domain))
        payload = {}
        payload['client_id'] = self.consumer_key,
        payload['client_secret'] = self.consumer_secret,
        r = requests.post(access_url,data=payload)
        cred = {'access_token': r.json()['access_token'],
                'refresh_token': r.json()['refresh_token']}
        return AlfrescoAuthenticationComplete(profile=profile,
                                              credentials=cred,
                                              provider_name=self.name,
                                              provider_type=self.type)
Wednesday, 3 July 2013
plone example
github.com/RedTurtle/
pas.plugins.velruse
Wednesday, 3 July 2013
plone example
github.com/RedTurtle/
pas.plugins.velruse
[app:main]
use = egg:myapp
pyramid.includes =
velruse.providers.facebook
velruse.providers.google
velruse.providers.twitter
velruse.facebook.consumer_key = 441361239240193
velruse.facebook.consumer_secret = 52ef2618a1999eeec6d9c
velruse.facebook.scope = email
velruse.twitter.consumer_key = 6453756375687365736
velruse.twitter.consumer_secret = 563475384g5yg4f5g3g85345f33ff34f
velruse.google.consumer_key = 72342425845745453534535353464535432
velruse.google.consumer_secret = hdfusdg76f78gaftsdf5s6d7f4sd5g4f
Wednesday, 3 July 2013
Grazie. Thank you.
Wednesday, 3 July 2013
Questions ?
Andrew Mleczko
Python Dev
Plone Framework Team
amleczko@redturtle.it
tw: @amleczko
Wednesday, 3 July 2013

More Related Content

Similar to Lost in o auth? learn velruse and get your life back

A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
IRJET Journal
 
Beyond VoiceOver: making iOS apps accessible
Beyond VoiceOver: making iOS apps accessibleBeyond VoiceOver: making iOS apps accessible
Beyond VoiceOver: making iOS apps accessible
Sally Shepard
 
Matt training-html-halfday
Matt training-html-halfdayMatt training-html-halfday
Matt training-html-halfdayMatthew Dobson
 
Storyplayer
StoryplayerStoryplayer
Storyplayer
Stuart Herbert
 
Windows Azure News - October 2013
Windows Azure News - October 2013Windows Azure News - October 2013
Windows Azure News - October 2013
paulbouwer
 
Design Patterns for Mobile Applications
Design Patterns for Mobile ApplicationsDesign Patterns for Mobile Applications
Design Patterns for Mobile Applications
C4Media
 
OSMC 2013 | Flapjack - monitoring notification system by Birger Schmidt
OSMC 2013 | Flapjack - monitoring notification system by Birger SchmidtOSMC 2013 | Flapjack - monitoring notification system by Birger Schmidt
OSMC 2013 | Flapjack - monitoring notification system by Birger Schmidt
NETWAYS
 
Antihackingblogspotcom
AntihackingblogspotcomAntihackingblogspotcom
AntihackingblogspotcomJames Jara
 
User stories through Five W's technique
User stories through Five W's  techniqueUser stories through Five W's  technique
User stories through Five W's technique
Eduardo Hernández Rangel, MCC, PMP, ITIL Cer, Scrum Master
 
Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...
Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...
Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...99X Technology
 
Introduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal LabsIntroduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal Labs
Alvaro Videla
 
Less Verbose ActionScript 3.0 - Write less and do more!
Less Verbose ActionScript 3.0 - Write less and do more!Less Verbose ActionScript 3.0 - Write less and do more!
Less Verbose ActionScript 3.0 - Write less and do more!
Arul Kumaran
 
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkKeeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro framework
Jeremy Kendall
 
Demystifying observability
Demystifying observability Demystifying observability
Demystifying observability
Abigail Bangser
 
2 Factor Authentication for Wordpress
2 Factor Authentication for Wordpress2 Factor Authentication for Wordpress
2 Factor Authentication for Wordpress
Askkiz - Security, Cloud & Social Media GRCS
 
Prototyping in the cloud
Prototyping in the cloudPrototyping in the cloud
Prototyping in the cloud
Kirsten Hunter
 
Android Security & Penetration Testing
Android Security & Penetration TestingAndroid Security & Penetration Testing
Android Security & Penetration Testing
Subho Halder
 
Create Accessible Infographics
Create Accessible Infographics Create Accessible Infographics
Create Accessible Infographics
Ted Drake
 
IRJET - Providing High Securtiy for Encrypted Data in Cloud
IRJET -  	  Providing High Securtiy for Encrypted Data in CloudIRJET -  	  Providing High Securtiy for Encrypted Data in Cloud
IRJET - Providing High Securtiy for Encrypted Data in Cloud
IRJET Journal
 
12115093PYTHONPROJECT.pdf
12115093PYTHONPROJECT.pdf12115093PYTHONPROJECT.pdf
12115093PYTHONPROJECT.pdf
AbhishekKumar66407
 

Similar to Lost in o auth? learn velruse and get your life back (20)

A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
 
Beyond VoiceOver: making iOS apps accessible
Beyond VoiceOver: making iOS apps accessibleBeyond VoiceOver: making iOS apps accessible
Beyond VoiceOver: making iOS apps accessible
 
Matt training-html-halfday
Matt training-html-halfdayMatt training-html-halfday
Matt training-html-halfday
 
Storyplayer
StoryplayerStoryplayer
Storyplayer
 
Windows Azure News - October 2013
Windows Azure News - October 2013Windows Azure News - October 2013
Windows Azure News - October 2013
 
Design Patterns for Mobile Applications
Design Patterns for Mobile ApplicationsDesign Patterns for Mobile Applications
Design Patterns for Mobile Applications
 
OSMC 2013 | Flapjack - monitoring notification system by Birger Schmidt
OSMC 2013 | Flapjack - monitoring notification system by Birger SchmidtOSMC 2013 | Flapjack - monitoring notification system by Birger Schmidt
OSMC 2013 | Flapjack - monitoring notification system by Birger Schmidt
 
Antihackingblogspotcom
AntihackingblogspotcomAntihackingblogspotcom
Antihackingblogspotcom
 
User stories through Five W's technique
User stories through Five W's  techniqueUser stories through Five W's  technique
User stories through Five W's technique
 
Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...
Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...
Colombo Mobile Developer MeetUp - Building Scalable Cloud Connected Mobile Ap...
 
Introduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal LabsIntroduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal Labs
 
Less Verbose ActionScript 3.0 - Write less and do more!
Less Verbose ActionScript 3.0 - Write less and do more!Less Verbose ActionScript 3.0 - Write less and do more!
Less Verbose ActionScript 3.0 - Write less and do more!
 
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkKeeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro framework
 
Demystifying observability
Demystifying observability Demystifying observability
Demystifying observability
 
2 Factor Authentication for Wordpress
2 Factor Authentication for Wordpress2 Factor Authentication for Wordpress
2 Factor Authentication for Wordpress
 
Prototyping in the cloud
Prototyping in the cloudPrototyping in the cloud
Prototyping in the cloud
 
Android Security & Penetration Testing
Android Security & Penetration TestingAndroid Security & Penetration Testing
Android Security & Penetration Testing
 
Create Accessible Infographics
Create Accessible Infographics Create Accessible Infographics
Create Accessible Infographics
 
IRJET - Providing High Securtiy for Encrypted Data in Cloud
IRJET -  	  Providing High Securtiy for Encrypted Data in CloudIRJET -  	  Providing High Securtiy for Encrypted Data in Cloud
IRJET - Providing High Securtiy for Encrypted Data in Cloud
 
12115093PYTHONPROJECT.pdf
12115093PYTHONPROJECT.pdf12115093PYTHONPROJECT.pdf
12115093PYTHONPROJECT.pdf
 

More from Andrew Mleczko

Celery and the social networks
Celery and the social networksCelery and the social networks
Celery and the social networks
Andrew Mleczko
 
PloneConf2012 - Are you in a hole and still digging? Or how to become an agil...
PloneConf2012 - Are you in a hole and still digging? Or how to become an agil...PloneConf2012 - Are you in a hole and still digging? Or how to become an agil...
PloneConf2012 - Are you in a hole and still digging? Or how to become an agil...
Andrew Mleczko
 
Project management software of your dreams
Project management software of your dreamsProject management software of your dreams
Project management software of your dreams
Andrew Mleczko
 
Bootstrap your app in 45 seconds
Bootstrap your app in 45 secondsBootstrap your app in 45 seconds
Bootstrap your app in 45 secondsAndrew Mleczko
 
PyconUA - How to build ERP application having fun?
PyconUA - How to build ERP application having fun?PyconUA - How to build ERP application having fun?
PyconUA - How to build ERP application having fun?Andrew Mleczko
 
EuroPython 2011 - How to build complex web applications having fun?
EuroPython 2011 - How to build complex web applications having fun?EuroPython 2011 - How to build complex web applications having fun?
EuroPython 2011 - How to build complex web applications having fun?
Andrew Mleczko
 
Future is bright, future is Plone
Future is bright, future is PloneFuture is bright, future is Plone
Future is bright, future is Plone
Andrew Mleczko
 
Needle in an enterprise haystack
Needle in an enterprise haystackNeedle in an enterprise haystack
Needle in an enterprise haystackAndrew Mleczko
 
Fast content import in Plone
Fast content import in PloneFast content import in Plone
Fast content import in PloneAndrew Mleczko
 
Plone TuneUp challenges
Plone TuneUp challengesPlone TuneUp challenges
Plone TuneUp challengesAndrew Mleczko
 

More from Andrew Mleczko (10)

Celery and the social networks
Celery and the social networksCelery and the social networks
Celery and the social networks
 
PloneConf2012 - Are you in a hole and still digging? Or how to become an agil...
PloneConf2012 - Are you in a hole and still digging? Or how to become an agil...PloneConf2012 - Are you in a hole and still digging? Or how to become an agil...
PloneConf2012 - Are you in a hole and still digging? Or how to become an agil...
 
Project management software of your dreams
Project management software of your dreamsProject management software of your dreams
Project management software of your dreams
 
Bootstrap your app in 45 seconds
Bootstrap your app in 45 secondsBootstrap your app in 45 seconds
Bootstrap your app in 45 seconds
 
PyconUA - How to build ERP application having fun?
PyconUA - How to build ERP application having fun?PyconUA - How to build ERP application having fun?
PyconUA - How to build ERP application having fun?
 
EuroPython 2011 - How to build complex web applications having fun?
EuroPython 2011 - How to build complex web applications having fun?EuroPython 2011 - How to build complex web applications having fun?
EuroPython 2011 - How to build complex web applications having fun?
 
Future is bright, future is Plone
Future is bright, future is PloneFuture is bright, future is Plone
Future is bright, future is Plone
 
Needle in an enterprise haystack
Needle in an enterprise haystackNeedle in an enterprise haystack
Needle in an enterprise haystack
 
Fast content import in Plone
Fast content import in PloneFast content import in Plone
Fast content import in Plone
 
Plone TuneUp challenges
Plone TuneUp challengesPlone TuneUp challenges
Plone TuneUp challenges
 

Recently uploaded

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 

Lost in o auth? learn velruse and get your life back

  • 1. agile.open.connectedLost In OAuth? Learn Velruse And Get Your Life Back! Andrew Mleczko Wednesday, 3 July 2013
  • 2. Andrew Mleczko Python Dev RedTurtle - Italy - Poland amleczko@redturtle.it @amleczko www.redturtle.it Andrew Mleczko Wednesday, 3 July 2013
  • 4. “OAuth is an open standard for authorization.” wikipedia Wednesday, 3 July 2013
  • 5. Lack of anonymity Lack of market saturation Phishing Data misuseBad precedents Wednesday, 3 July 2013
  • 6. This talk is not about it! Wednesday, 3 July 2013
  • 10. minimal configuration use or as a stand-alone service pyramid plugin Wednesday, 3 July 2013
  • 12. as a service [app:velruse] use = egg:velruse endpoint = http://example.com/logged_in provider.facebook.consumer_key = 441361239240193 provider.facebook.consumer_secret = 52ef2618a1999eeec6d9c provider.facebook.scope = email ... Wednesday, 3 July 2013
  • 13. handling login # sample callback view in flask @app.route('/logged_in', methods=['POST']) def login_callback(): # token is stored in the form data token = request.form['token'] return render_template('result.html', result=token) # sample callback view in flask @app.route('/logged_in', methods=['POST']) def login_callback(): token = request.form['token'] # the request must contain 'format' and 'token' params payload = {'format': 'json', 'token': token} # sending a GET request to /auth_info response = requests.get(request.host_url + 'velruse/auth_info', params=payload) auth_info = response.json return render_template('result.html', result=auth_info) Wednesday, 3 July 2013
  • 14. as a pyramid plugin [app:main] use = egg:myapp pyramid.includes = velruse.providers.facebook velruse.facebook.consumer_key = 441361239240193 velruse.facebook.consumer_secret = 52ef2618a1999eeec6d9c velruse.facebook.scope = email ... Wednesday, 3 July 2013
  • 15. handling login @view_config( context='velruse.AuthenticationComplete', renderer='myapp:templates/result.mako', ) def login_complete_view(request): context = request.context result = { 'provider_type': context.provider_type, 'provider_name': context.provider_name, 'profile': context.profile, 'credentials': context.credentials, } return {'result': json.dumps(result, indent=4)} @view_config( context='velruse.providers.facebook.FacebookAuthenticationComplete', renderer='myapp:templates/result.mako', ) def fb_login_complete_view(request): pass Wednesday, 3 July 2013
  • 17. Google OAuth2 example [app:velruse] use = egg:velruse endpoint = http://example.com/logged_in provider.google.consumer_key = 441361239240193 provider.google.consumer_secret = 52ef2618a1999eeec6d9c Wednesday, 3 July 2013
  • 18. alfresco example github.com/RedTurtle/ pyramid_alfresco [app:main] use = egg:myapp pyramid.includes = pyramid_alfresco.oauth alfresco.consumer_key = 441361239240193 alfresco.consumer_secret = 52ef2618a1999eeec6d9c Wednesday, 3 July 2013
  • 19. alfresco example class AlfrescoProvider(object):     def login(self, request):         """Initiate a alfresco login"""         scope = request.POST.get('scope', self.scope)         gh_url = flat_url(             '%s://%s/auth/oauth/versions/2/authorize' % (self.protocol, self.domain),             scope=scope,             response_type='code',             client_id=self.consumer_key,             redirect_uri=request.route_url(self.callback_route),             state=state)         return HTTPFound(location=gh_url) Wednesday, 3 July 2013
  • 20. alfresco example class AlfrescoProvider(object): ...     def callback(self, request):         """Process the alfresco redirect"""         sess_state = request.session.get('state')         req_state = request.GET.get('state')         access_url = flat_url('%s://%s/auth/oauth/versions/2/token' % (self.protocol, self.domain))         payload = {}         payload['client_id'] = self.consumer_key,         payload['client_secret'] = self.consumer_secret,         r = requests.post(access_url,data=payload)         cred = {'access_token': r.json()['access_token'],                 'refresh_token': r.json()['refresh_token']}         return AlfrescoAuthenticationComplete(profile=profile,                                               credentials=cred,                                               provider_name=self.name,                                               provider_type=self.type) Wednesday, 3 July 2013
  • 22. plone example github.com/RedTurtle/ pas.plugins.velruse [app:main] use = egg:myapp pyramid.includes = velruse.providers.facebook velruse.providers.google velruse.providers.twitter velruse.facebook.consumer_key = 441361239240193 velruse.facebook.consumer_secret = 52ef2618a1999eeec6d9c velruse.facebook.scope = email velruse.twitter.consumer_key = 6453756375687365736 velruse.twitter.consumer_secret = 563475384g5yg4f5g3g85345f33ff34f velruse.google.consumer_key = 72342425845745453534535353464535432 velruse.google.consumer_secret = hdfusdg76f78gaftsdf5s6d7f4sd5g4f Wednesday, 3 July 2013
  • 24. Questions ? Andrew Mleczko Python Dev Plone Framework Team amleczko@redturtle.it tw: @amleczko Wednesday, 3 July 2013