markbates / goth

Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applications.
https://blog.gobuffalo.io/goth-needs-a-new-maintainer-626cd47ca37b
MIT License
5.52k stars 591 forks source link

How to use Goth With React Applications #416

Open PuneetPunamiya opened 3 years ago

PuneetPunamiya commented 3 years ago

Currently goth does all the authentication on a single port. I have a use case where the user will click on a button on UI which is React Application saying Sign In With Github and other buttons with other provider name running on a different port. UI will send request to goth server and goth server should retun user details once authenticated

In short React Application running on port 3000 image

Once clicked on button request should be send to goth server running on a port say 4200, does all authentication process and once authenticated goth server returns user details back to React Application

PuneetPunamiya commented 3 years ago

@bentranter Could you please take a look at this once ??

apoorvcodes commented 3 years ago

https://www.loginradius.com/blog/async/google-authentication-with-golang-and-goth/

apoorvcodes commented 3 years ago

this may help you

PuneetPunamiya commented 3 years ago

@apoorvcodes thanks for this but this is still for a go web application right. My use case was separate ui application and a separate server which uses goth

hsluoyz commented 2 years ago

@PuneetPunamiya maybe you can try Casdoor: https://github.com/casbin/casdoor

Here's a forum program demo: https://forum.casbin.com/ , click the "Sign In" button and you will get something like:

image