OAuth with google account..

Hi All,

I was given a login screen to implement with OAuth, where it’s ONLY allowd to use the google account of the user.
I found the OAuth addon for vaadin 7, but there’s no google account configuration for that. (
https://vaadin.com/directory#addon/oauth-popup-add-on
)

Can someone please tell me how to achieve this goal…?
Any help is greatly appreciated.

Thanks in advance,
Cheers,
Asela.

I fought with this a bit last week and made it work. It neeeds a small change to the add-on, the “response path” needs to be static with Google OAuth. I’ll try to share the solutions later today.

cheers,
matti

Hi Matti,

Thanks for the quick response. I will await your solution.
Thanks again.

Cheers,
Asela.

Hi,

This is the issue I faced:
https://github.com/ahn/vaadin-oauthpopup/issues/2
The report contains a link to workaround.

For a full example how it works, check out this in progress project:

CollaMap

You might also need to remove some -SNAPSHOT versions or build them them locally (sources at my github page), but other than that should run out of the box in IDE. Once you check it: add your own keys here and remove the “.example” from the file name:

https://github.com/mstahv/collamap/blob/master/src/main/resources/application.properties.example

It is a Spring Boot app, so just launch the main method in Application class, but you should be able to copy the essential stuff to any Vaadin app at all.

cheers,
matti

Hello,

I was wondering if your related project (Collamap) is actually working properly. I found a related issue when using
Spring Boot + OAuthPopup
where the following message is being displayed:


Failed to load the bootstrap javascript: ./…/VAADIN/vaadinBootstrap.js?v=7.6.4

And I am currently facing the same issue. This has already been reported:
https://github.com/ahn/vaadin-oauthpopup/issues/12

I would appreciate if you could take a look at it.

Cheers,
Giovany

Hi,

Have you seen this blog post about OAuth and Vaadin:


https://vaadin.com/blog/-/blogs/implementing-sign-in-with-google-s-oauth-2-services

That is how I’m implementing Oauth in my hobby apps.

cheers,
matti

I meant to use the OAuthPopup Plugin but your solution using Scribe directly and a custom RequestHandler worked very well.

Thanks a lot for your response Matti.

Cheers