File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ If you're using `bower` they will be automatically downloaded upon installing th
3131<script src =" <VENDOR_FOLDER>/angular-oauth2/dist/angular-oauth2.min.js" ></script >
3232```
3333
34- ###### 3. Configure ` OAuth ` (required ) and ` OAuthToken ` (optional):
34+ ###### 3. Configure ` OAuth ` (optional ) and ` OAuthToken ` (optional):
3535
3636``` js
3737angular .module (' myApp' , [' angular-oauth2' ])
@@ -44,7 +44,18 @@ angular.module('myApp', ['angular-oauth2'])
4444 }]);
4545```
4646
47- ps: You can also configure service at runtime, in case you retrieve oauth server configuration from a ajax request.
47+ You can also configure ` OAuth ` service in a ` .run() ` block, in case you retrieve the Oauth server configuration from a ajax request.
48+
49+ ``` js
50+ angular .module (' myApp' , [' angular-oauth2' ])
51+ .run ([' OAuth' , function (OAuth ) {
52+ OAuth .configure ({
53+ baseUrl: ' https://api.website.com' ,
54+ clientId: ' CLIENT_ID' ,
55+ clientSecret: ' CLIENT_SECRET' // optional
56+ });
57+ }]);
58+ ```
4859
4960###### 4. Catch ` OAuth ` errors and do something with them (optional):
5061
You can’t perform that action at this time.
0 commit comments