phartenfeller / gatsby-philipps-foam-theme

Foam theme for Gatsby
https://phartenfeller.github.io/gatsby-philipps-foam-theme/
Other
18 stars 2 forks source link

How to create a Google Authentication for Digital Garden #15

Open t2hv33 opened 2 years ago

t2hv33 commented 2 years ago

Hi @phartenfeller How to put Google Authentication for Foam Gatsby?

Expected:

  1. When User access index page of Foam
  2. It will display popup Google Login (Admin will config which user have approved to see the data)

At 2) will have 2 cases Case 1: All pages are not available for guests, Login is required to browse the pages. Case 2: Public pages will be available for guest, hidden pages will require Login

Currently, have any quick walkthrough to deploy Case 1? Best regards,

phartenfeller commented 2 years ago

Hi!

Because this is currently on Gatsby 3, it just generates static html for all the pages. So this is something you could achieve on your webserver or proxy, where the pages are served.

I use authelia in front of my webserver to require login to see any pages. If you want I can share my setup, but it is very specific to my stack(Traefik with docker-compose). Page based authentication and authorization could be tricky.

Gatsby 4 introduced server-side rendering. With that it should be possible, but I currently don't have the time to look into it. Gatsby 4 does also not feel ready yet for me because some plugins are not upgraded yet.

Best regards!