background preloader

Oauth

Facebook Twitter

Intridea/oauth2. OAuth 2.0 — OAuth. OAuth 2.0 is the industry-standard protocol for authorization.

OAuth 2.0 — OAuth

OAuth 2.0 supersedes the work done on the original OAuth protocol created in 2006. OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications, desktop applications, mobile phones, and living room devices. This specification and its extensions are being developed within the IETF OAuth Working Group.

Questions, suggestions and protocol changes should be discussed on the mailing list. OAuth 2.0 Core 🍎 What the Heck is Sign In with Apple? Sign In with Apple is based on OAuth 2.0 and OpenID Connect, and provides a privacy-friendly way for users to sign in to websites and apps. Mobile and Other Devices. Twitter Authentication in Sinatra. At the recent Summit Awesome Hackathon in Manchester, my team were working on a web app that updated a user’s bio on various social networks in one place.

Twitter Authentication in Sinatra

This meant getting down and dirty with various social network APIs (not a pretty thing I can tell you). I thought I’d do a quick write up on how you can authenticate users in a Sinatra app by allowing them to sign in with Twitter. Set Up The Site To demonstrate this working, first of all, let’s set up a simple app that has two urls – public and private. Save the following code in a file called ‘main.rb': This sets up a helper method called admin? The second route is a private page that will only show the message if the admin? Using Sessions to Log in and Out. Sinatro OAuth Workflow: Speed Up Your App Development. Google API – Sinatra + OAuth2. Here is a quick example of using the Google with OAuth2 and Sinatra and it should take less than 20 minutes to get running!

Google API – Sinatra + OAuth2

If you’re here to figure out how to use GMail’s API with OAuth2 then you should know it does not work as of 7/23/2012. Use OAuth 1.0/XOAUTH. Requirements Ruby 1.8.7+Bundler (gem install bundler) We will also need a Google Client ID and Secret. Let’s run Okay by this point we have Ruby, Bundler, and our Google credentials. Let’s create a few of our boilerplate files we’ll be using.

Next, run this command to get our dependencies installed: We’re going to run Sinatra as a rack application. Line 7 of the above code snippet should make you a bit concerned since we have not created an app.rb file yet so that require is going to throw an error. But before we add app.rb I really want to get the rest of the little stuff out of the way.

Sinatra — Documentation for demandforce/rack-oauth2-server (master) Using the LinkedIn API with OAuth2 and Ruby » Big TrapezeBig Trapeze. In my experience with programmatically connecting to the major social networks, the LinkedIn API seems to be the hardest to get a quick grasp on.

Using the LinkedIn API with OAuth2 and Ruby » Big TrapezeBig Trapeze

There’s a lot of outdated information, disparate and competing Ruby gems, and general confusion about how to simply connect and get data back. Normally, I use the OmniAuth Gems and their respective strategies to get data from social networks, but the LinkedIn one just wasn’t cutting it like I needed it to. For example, the official strategy for working with LinkedIn– close, but doesn’t allow for a custom callback URL, instead relying on one you’d have to hardcode during the application setup at LinkedIn.

This is fine if you’re only developing for a single domain, but many of us use multiple domains (typically, production, development and/or test domains) when developing an app. So, here’s the approach I’ve taken, and it’s worked great so far: You’ll also want to select the default scope for your application. Ruby API Example. How to use APIs with Ruby. Rack-oauth2-server. OAuth 2.0 Authorization Server as a Rack module.

rack-oauth2-server

Because you don't allow strangers into your app, and OAuth 2.0 is the new awesome. rack-oauth2-server currently implements version 10 of the OAuth 2.0 spec For more background, check out the presentation slides. Adding OAuth 2.0 To Your Application Step 1: Setup Your Database The authorization server needs to keep track of clients, authorization requests, access grants and access tokens. The current release uses MongoDB. If MongoDB is not your flavor, you can easily change the models to support a different database engine. Step 2: Use The Server For Rails 2.3/3.0, Rack::OAuth2::Server automatically adds itself as middleware when required, but you do need to configure it from within config/environment.rb (or one of the specific environment files). OAuth 2.0. OAuth2 Consumer With Sinatra - Gazler.

This is part 2 of creating an OAuth based API with rails.

OAuth2 Consumer With Sinatra - Gazler

Part 1 is available here. Source The source for both the provider and the consumer are available here Screencasts I have created screencasts to go along with this tutorial. Download mp4 format ogv format avi format.