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
+9-4
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,9 @@ A Polymer 2.0 Element that performs the OAuth2 authorization code flow using a p
4
4
5
5
## Usage
6
6
7
-
1. Set up your OAuth2 config properly (Client ID, Redirect URL, etc.)
8
-
2. Include the `oauth-authorizator` element on your page like this:
7
+
1. Properly polyfill [`URL`][1], [`URLSearchParams`][2] and [`fetch`][3], so that `fetch` can work with `URLSearchParams`-objects. `<oauth-receiver>` only needs [`URLSearchParams`][2].
8
+
2. Set up your OAuth2 config properly (Client ID, Redirect URL, etc.)
9
+
3. Include the `oauth-authorizator` element on your page like this:
authorization-url="The URL that will be loaded in the popup window, e.g. https://accounts.spotify.com/authorize"
@@ -16,15 +17,19 @@ A Polymer 2.0 Element that performs the OAuth2 authorization code flow using a p
16
17
token-refresh-url="The URL where your token refresh server is located">
17
18
</oauth-authorizator>
18
19
```
19
-
3. Set up the `oauth-receiver` on the redirect page
20
+
4. Set up the `oauth-receiver` on the redirect page
20
21
```html
21
22
<oauth-receivertarget="Optional, the site you're hosting your website on. E.g. https://festify.us"></oauth-receiver>
22
23
```
23
-
4. Call `oauth-authorizator.login()` at the appropriate time to start the authorization process. The access token will appear as observable property at `oauth-authorizator.accessToken` or will be available through the Promise's return value.
24
+
5. Call `oauth-authorizator.login()` at the appropriate time to start the authorization process. The access token will appear as observable property at `oauth-authorizator.accessToken` or will be available through the Promise's return value.
24
25
25
26
## Manual Mode
26
27
27
28
If you set the `manual`-attribute on `<oauth-receiver>`, the element will not attempt to parse the parameters on page load. Instead, you will need to call `<oauth-receiver>.receive()` in order to parse and send the OAuth get parameters. This could be useful if you want to show the user some content before redirecting back to the application.
0 commit comments