You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-15Lines changed: 11 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ JavaScript library for using OAuth 2.0 Implicit Grant flow (Client-Side Flow) or
8
8
9
9
This creates an OAuth 2.0 Ember object class for handling authentication with OAuth 2.0 providers.
10
10
11
-
Current Version: **[2.0.2-beta](https://github.com/amkirwan/ember-oauth2/releases/tag/v2.0.2-beta)**
11
+
Current Version: **[2.0.3-beta](https://github.com/amkirwan/ember-oauth2/releases/tag/v2.0.3-beta)**
12
12
13
-
The EmberCli addon [EmberTokenAuth](https://github.com/amkirwan/ember-token-auth) demonstrates how to use Ember-OAuth2 library for authentication.
13
+
The EmberCli addon [EmberTokenAuth](https://github.com/amkirwan/ember-token-auth) demonstrates how to use Ember-OAuth2 library for authentication.
14
14
15
15
## Dependencies
16
16
@@ -21,15 +21,15 @@ Ember-OAuth2 requires Ember and jQuery.
21
21
22
22
Ember-OAuth2 uses localStorage for saving the tokens, localStorage is supported in Firefox 3.5+, Safari 4+, IE9+, and Chrome.
23
23
24
-
The latest version of Ember-OAuth2 is an Ember Addon and uses the ES6 modules. This allows Ember-OAuth2 to be used in projects like [EmberCLI](https://github.com/stefanpenner/ember-cli) easier.
24
+
The latest version of Ember-OAuth2 is an Ember Addon and uses the ES6 modules. This allows Ember-OAuth2 to be used in projects like [EmberCLI](https://github.com/stefanpenner/ember-cli) easier.
25
25
26
26
27
27
## Installation
28
28
29
29
Ember-OAuth2 is an Ember Addon that can be installed with the following command from your ember project.
30
30
31
31
```javascript
32
-
$ ember install ember-oauth2
32
+
$ ember install ember-oauth2
33
33
```
34
34
35
35
Ember-OAuth2 is an Ember [service](https://guides.emberjs.com/v2.8.0/applications/services/) that you can inject to different parts of your app using the inject syntax
@@ -109,7 +109,7 @@ The following are the options available for configuring a provider:
109
109
110
110
## Authorization
111
111
112
-
To sign into the OAuth2 provider create by injecting the service, set the provider with `setProvider` and call the `authorize`. You can inject this addon into your route for example and when the user clicks a button fire the action to handle the request and set the service providerId and call authorize. This is a simple example and you would probably want to wrap this functionality in a session model. Checkout [ember-token-auth](https://github.com/amkirwan/ember-token-auth) for a full example.
112
+
To sign into the OAuth2 provider create by injecting the service, set the provider with `setProvider` and call the `authorize`. You can inject this addon into your route for example and when the user clicks a button fire the action to handle the request and set the service providerId and call authorize. This is a simple example and you would probably want to wrap this functionality in a session model. Checkout [ember-token-auth](https://github.com/amkirwan/ember-token-auth) for a full example.
113
113
114
114
```javascript
115
115
// login route
@@ -162,7 +162,7 @@ The `authorize` call returns a `Ember.RSVP.Promise`. Authorize will `resolve` wi
162
162
163
163
})
164
164
165
-
When using the client-side flow it is vital to validate the token received from the endpoint, failure to do so will make your application vulnerable to the [confused deputy problem](https://en.wikipedia.org/wiki/Confused_deputy_problem). As of version `v1.0.2` Ember-OAuth2 supports the `verifyToken` method for validating tokens when using the client-side flow. The user will need to override this method for validating the different server endpoints.
165
+
When using the client-side flow it is vital to validate the token received from the endpoint, failure to do so will make your application vulnerable to the [confused deputy problem](https://en.wikipedia.org/wiki/Confused_deputy_problem). As of version `v1.0.2` Ember-OAuth2 supports the `verifyToken` method for validating tokens when using the client-side flow. The user will need to override this method for validating the different server endpoints.
166
166
167
167
Here is an example of how this might be accomplished in an Ember-CLI instance initializer using the Google token validation endpoint.
168
168
@@ -178,7 +178,7 @@ export function initialize(app) {
// implement the adapter with the url to the google tokeinfo endpoint
184
184
var adapter =app.lookup('adapter:session');
@@ -196,7 +196,7 @@ function verifyTokenInit(app) {
196
196
});
197
197
}
198
198
199
-
exportdefault {
199
+
exportdefault {
200
200
name:'ember-oauth2',
201
201
initialize: initialize
202
202
};
@@ -210,7 +210,7 @@ export default {
210
210
211
211
If using the Authorization Grant flow with your provider your backend server will need to handle the final steps of authorizing your application. Your success handler will need to send the `AUTHORIZATON_CODE` returned from OAuth2 provider to your backend server which can then retrieve an access token using the client_id, client_secret, and authorization_code.
212
212
213
-
To enable the Authorization Grant flow for a provider set the `responseType` value to `code`.
213
+
To enable the Authorization Grant flow for a provider set the `responseType` value to `code`.
0 commit comments