Sha256: e286352aa81e3845c3d395a9b35c350318960a088385817b96d4340ef87f8d80
Contents?: true
Size: 1.13 KB
Versions: 1
Compression:
Stored size: 1.13 KB
Contents
Jibeset ==== Configure --------- ```ruby # Configure your client with the credentials you got from # registering your application at jibeset.heroku.com/oauth_clients Jibeset.configure do |config| config.client_id = 'YOUR_CLIENT_ID' config.client_secret = 'YOUR_CLIENT_SECRET' config.endpoint = 'http://jibeset.heroku.com/' config.oauth_callback = 'http://yourapp.example.com/oauth_callback' end ``` Authorization Flow ------------------ ```ruby # Get an authorization code from the JibeSet OAuth Provider # Pretend this is in a sinatra app get '/auth/oauth' do redirect Jibeset.authorize_url end # Use the authorization code to get an access code # This will be the action that your callback URL redirects to get '/auth/oauth/callback' do response = Jibeset.get_access_token(params[:code], :redirect_uri => oauth_callback) token = JSON.parse(response.body)["access_token"] # Store the access token in the session so you can get it later to sign # subsuquent requests. session[:jibeset_token] = token # Create a client client = Jibeset.client(:access_token => token) client.me # => returns authenticated user end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jibeset-0.2 | README.markdown |