Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/savareyhano/elysia-google-oauth
Implementation of Google OAuth using no libraries and using libraries with Elysia and Bun
https://github.com/savareyhano/elysia-google-oauth
bun elysia elysiajs google google-oauth google-oauth2 googleapis oauth oauth2
Last synced: about 1 month ago
JSON representation
Implementation of Google OAuth using no libraries and using libraries with Elysia and Bun
- Host: GitHub
- URL: https://github.com/savareyhano/elysia-google-oauth
- Owner: savareyhano
- Created: 2024-08-14T15:22:05.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-08-16T17:03:24.000Z (5 months ago)
- Last Synced: 2024-10-31T03:05:59.349Z (3 months ago)
- Topics: bun, elysia, elysiajs, google, google-oauth, google-oauth2, googleapis, oauth, oauth2
- Language: TypeScript
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elysia OAuth Google
## Web server applications
The authorization sequence begins when your application redirects a browser to a Google URL; the URL includes query parameters that indicate the type of access being requested. Google handles the user authentication, session selection, and user consent. The result is an authorization code, which the application can exchange for an access token and a refresh token.
The application should store the refresh token for future use and use the access token to access a Google API. Once the access token expires, the application uses the refresh token to obtain a new one.
![](https://developers.google.com/static/identity/protocols/oauth2/images/flows/authorization-code.png)
Useful references:
- [OAuth 2.0 Playground](https://developers.google.com/oauthplayground/)
- [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes)
- [OpenID Connect](https://developers.google.com/identity/openid-connect/openid-connect)
- [Using OAuth 2.0 for Web Server Applications](https://developers.google.com/identity/protocols/oauth2/web-server)## Development
To start the development server run:
```bash
bun run dev # for running the google oauth without using any libraries
bun run dev:arctic # for running the google oauth using arctic library
bun run dev:googleapis # for running the google oauth using googleapis library
```Open http://localhost:3000/auth/google with your browser to see the result.