https://github.com/festify/oauth-authorizator
A Polymer 2.0 element that performs the OAuth authorization code flow.
https://github.com/festify/oauth-authorizator
oauth2-authorization polymer web-component
Last synced: 4 months ago
JSON representation
A Polymer 2.0 element that performs the OAuth authorization code flow.
- Host: GitHub
- URL: https://github.com/festify/oauth-authorizator
- Owner: Festify
- License: mit
- Created: 2017-06-18T11:15:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-31T12:43:55.000Z (over 8 years ago)
- Last Synced: 2025-07-24T03:58:19.547Z (11 months ago)
- Topics: oauth2-authorization, polymer, web-component
- Language: HTML
- Homepage:
- Size: 23.4 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# \
A Polymer 2.0 Element that performs the OAuth2 authorization code flow using a popup window.
## Usage
1. Properly polyfill [`URL`][1], [`URLSearchParams`][2] and [`fetch`][3], so that `fetch` can work with `URLSearchParams`-objects. `` only needs [`URLSearchParams`][2].
2. Set up your OAuth2 config properly (Client ID, Redirect URL, etc.)
3. Include the `oauth-authorizator` element on your page like this:
```html
```
4. Set up the `oauth-receiver` on the redirect page
```html
```
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.
## Manual Mode
If you set the `manual`-attribute on ``, the element will not attempt to parse the parameters on page load. Instead, you will need to call `.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.
## License
MIT
[1]: https://developer.mozilla.org/en-US/docs/Web/API/URL
[2]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
[3]: https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch