README.md in oauth2-client-1.1.0 vs README.md in oauth2-client-1.1.1

- old
+ new

@@ -1,12 +1,16 @@ # OAuth2 Ruby Client [![Gem Version](https://badge.fury.io/rb/oauth2-client.png)][gem] [![Build Status](https://secure.travis-ci.org/tiabas/oauth2-client.png?branch=master)][travis] +[![Dependency Status](https://gemnasium.com/tiabas/oauth2-client.png)][gemnasium] +[![Coverage Status](https://coveralls.io/repos/tiabas/oauth2-client/badge.png?branch=master)][coveralls] [gem]: https://rubygems.org/gems/oauth2-client [travis]: http://travis-ci.org/tiabas/oauth2-client +[gemnasium]: https://gemnasium.com/tiabas/oauth2-client +[coveralls]: https://coveralls.io/r/tiabas/oauth2-client A Ruby wrapper for the OAuth 2.0 specification. It is designed with the philosophy that different service providers implement OAuth 2.0 differently and not exactly according to the [RFC]( http://tools.ietf.org/html/rfc6749). This gem therefore, affords the developer some degree of flexibility in creating a client that will work with different OAuth2 @@ -41,15 +45,15 @@ ``` ## Authorization Grants The client wraps around the creation of any given grant and passing in the parameters defined in the configuration file. The supported grants include Authorization Code, Implicit, Resource Owner Password Credentials, Client Credentials. -There is also support for device authentication as described in Google's OAuth 2.0 authentication methods(https://developers.google.com/accounts/docs/OAuth2ForDevices). They are available via the #authorization_code, #implicit, #password, #client_credentials, #refresh_token -and #device methods on a client object. +There is also support for device authentication as described in Google's OAuth 2.0 authentication methods(https://developers.google.com/accounts/docs/OAuth2ForDevices). They are available via the `authorization_code`, `implicit`, `password`, `client_credentials`, `refresh_token` +and `device` methods on a client object. -The #get_token method on the grants does not make any assumptions about the format ofthe response from the OAuth provider. The ideal -case would be to treat all responses as JSON. However, some services may respond with in XML instead of JSON. The #get_token method +The `get_token` method on the grants does not make any assumptions about the format ofthe response from the OAuth provider. The ideal +case would be to treat all responses as JSON. However, some services may respond with in XML instead of JSON. The `get_token` method therefore, returns with an HTTPResponse object. ### Authorization Code ```ruby auth_url = client.authorization_code.authorization_path(:redirect_uri => 'http://localhost/oauth2/cb') @@ -90,17 +94,17 @@ # exchange device authorization code for access token token = client.device_code.get_token(device_auth_code) ``` # Using a custom Http wrapper -By default, oauth2-client uses a Net::HTTP wrapper called OAuth2::HttpConnection. However, if you wish to use a different HTTP library, you only +By default, oauth2-client uses a `Net::HTTP` wrapper called `OAuth2::HttpConnection`. However, if you wish to use a different HTTP library, you only need to create a wrapper around your favorite library that will respond to the `send_request` method. ```ruby class TyphoeusHttpConnection - def initalize(site_url, connection_options={}) + def initialize(site_url, connection_options={}) # set url and connection options @site_url = site_url @connection_options = connection_options end @@ -183,16 +187,16 @@ response.inspect # => #<Net::HTTPOK:0x007ff8bc7c1200> response.body # => { - "access_token" : "ya91.AHES8ZS-oCZnc5yHepnsosFjNln9ZKLuioF6FcMRCGUIzA", - "token_type" : "Bearer", - "expires_in" : 3600, - "id_token" : "eyJhbGciOiJSUzI1NiIsImtpZCI6IjY4ZGM2ZmIxNDQ5OGJmMWRhNjNiMWYyMDA2YmRmMDA2N2Q4MzY", - "refresh_token" : "6/Ju8uhi9xOctGEyHRzWwHhaYimfxmY0tiJ_qW3qvjWXM" -} +# "access_token" : "ya91.AHES8ZS-oCZnc5yHepnsosFjNln9ZKLuioF6FcMRCGUIzA", +# "token_type" : "Bearer", +# "expires_in" : 3600, +# "id_token" : "eyJhbGciOiJSUzI1NiIsImtpZCI6IjY4ZGM2ZmIxNDQ5OGJmMWRhNjNiMWYyMDA2YmRmMDA2N2Q4MzY", +# "refresh_token" : "6/Ju8uhi9xOctGEyHRzWwHhaYimfxmY0tiJ_qW3qvjWXM" +#} ``` ## Github Client ```ruby @@ -217,12 +221,12 @@ response.inspect # => #<Net::HTTPOK:0x007ff8bc7c1200> response.body # => { - "access_token" : "e409f4272fe539166a77c42479de030e7660812a", - "token_type" : "bearer" - }" +# "access_token" : "e409f4272fe539166a77c42479de030e7660812a", +# "token_type" : "bearer" +# }" ``` ## Supported Ruby Versions This library aims to support and is [tested against][travis] the following Ruby version: \ No newline at end of file