Giter VIP home page Giter VIP logo

springoauth2's Introduction

Integration of OAuth2 and Spring Boot with Vaadin Flow

This project is a demo intended to test the integration concept of OAuth2, Spring Boot, and Vaadin Flow with the Google Calendar API

Prerequisites

Before running this project, make sure to have the following properties configured in the application.properties file:

account.google.client-id:${ACCOUNT_GOOGLE_CLIENT_ID:...}
account.google.client-secret:${ACCOUNT_GOOGLE_SECRET:...}
account.google.redirect-uri:${ACCOUNT_GOOGLE_REDIRECT_URI:https://.../api/google/callback}

Replace the ... values with your Google account configuration. You can follow the Google Calendar API Quickstart guide to obtain these values.

Google Console Configuration

To correctly configure OAuth2 credentials in the Google Console, follow these steps:

  1. Create a new project: Create a new project in the Google Console for your application.
  2. Enable the API: Enable the corresponding API, in this case, the Google Calendar API.
  3. Configure OAuth consent: Configure the OAuth consent screen with your application details.
  4. Authorize credentials for a web application: Create OAuth2 credentials of type OAuth 2.0 Client IDs for a web application and ensure to provide the correct redirect URI.

To generate the correct redirect URI, you need an https protocol. To achieve this, we can use ngrok.

ngrok Configuration

To ensure the correct functioning of the Webhook in the OAuth 2.0 Client IDs section specifically in Authorized redirect URIs, it is mandatory to provide a URL with the HTTPS protocol. This is essential to maintain the security of communications between the server and the client application.

Steps to configure ngrok:

  1. Download ngrok from ngrok.com
  2. Unzip the downloaded file and start ngrok in your terminal by running the following command (replace PORT with the port your local server is running on):
ngrok http 54154

Ngrok will generate a public URL that you can use as the Authorized redirect URI in the Google Console.

With these configurations correctly set up in the Google Console and the corresponding values entered in the application.properties file, the application should function correctly after running the command

# Mac & Linux
./mvnw
# Windows
mvnw

Note:

  • This demo focuses on Google Calendar to display holidays in the locality configured in the calendar. The visual part of Vaadin Flow displays these holidays to provide useful functionality to the user.

  • Remember that this application is designed as a demonstration and can be extended to include more features and functionalities as needed.

springoauth2's People

Contributors

fredpena avatar

Stargazers

aubrey avatar Patricio Bonilla avatar

Watchers

 avatar

springoauth2's Issues

๐Ÿงš๐Ÿค– Pixeebot Activity Dashboard

DashList

๐Ÿ‘‹ This dashboard summarizes my activity on the repository, including available improvement opportunities.

Recommendations

Last analysis: Sep 21 | Next scheduled analysis: Sep 28

Open

โœ… Nice work, you're all caught up!

Available

โœ… Nothing yet, but I'm continuing to monitor your PRs.

Metrics

What would you like to see here? Let us know!

Resources

๐Ÿ“š Quick links
Pixee Docs | Codemodder by Pixee

๐Ÿงฐ Tools I work with
SonarCloud | SonarQube | CodeQL | Semgrep

๐Ÿš€ Pixee CLI
The power of my codemods in your local development environment. Learn more

๐Ÿ’ฌ Reach out
Feedback | Support


โค๏ธ Follow, share, and engage with Pixee: GitHub | LinkedIn | Slack

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.