Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Google Login. #89

Merged
merged 3 commits into from
Jul 7, 2024
Merged

Added Google Login. #89

merged 3 commits into from
Jul 7, 2024

Conversation

opsnin
Copy link

@opsnin opsnin commented Jun 25, 2024

  • Added Login with google in UI.
  • Added a DB field to check whether user is allowed or not. IF it is authencated with google allowed is set to true.
  • Modified build.sh the sed command had some issues so it wasnot able to update the Dockerfile. Also the arm64 architecutre was missing added it too.
  • Gogle configurations can be passed as Environment Variables. Here we can update secrets , cliendID from google developer console and allowed domains checked which email domains are allowed. Required ENV variables for google login to work.
     GOOGLE_CLIENT_ID
     GOOGLE_CLIENT_SECRET
     GOOGLE_REDIRECT_URL
     ALLOWED_DOMAINS
  • Two new modules were added,
    1. golang.org/x/oauth2 v0.21.0
    2 . google.golang.org/api v0.185.0
  • Updated login.html to show button for login with google. By default the google logged in Users don't have Admin access.

@d3vilh d3vilh self-assigned this Jun 30, 2024
@d3vilh
Copy link
Owner

d3vilh commented Jun 30, 2024

Thank you! Let me test it with different archs and we good to go with merging to main.

@d3vilh d3vilh added the enhancement New feature or request label Jun 30, 2024
@droid-sheep
Copy link

@janamkhatiwada Is it possible to enhance this feature for a general implementation of OAuth? Described in #75 this feature is requested by some people (and myself). This would establish openvpn-ui to a mentionable competitor against enterprise vpn solutions with a user portal and would be interesting for companies.

I would support this but i can't write GO code.

@d3vilh d3vilh merged commit ff0cec7 into d3vilh:main Jul 7, 2024
@d3vilh d3vilh self-requested a review July 7, 2024 06:21
@d3vilh
Copy link
Owner

d3vilh commented Jul 7, 2024

I merge it, but updated build process, so it will support arm64 in addition to aarm64.

I think, we need option to enable Google login in OpenVPN-UI settings and few more options on the same page to set GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REDIRECT_URL, ALLOWED_DOMAINS, not just env but manually.

All these would be nice to have to make login page a bit more user-friendly if someday in the future we wild add new auth method (Oauth?).

Planning to do it next couple of weeks and then we could have new major release with all the containers rebuild.

@janamkhatiwada thanks a lot for great idea and nice implementation.

@d3vilh
Copy link
Owner

d3vilh commented Jul 7, 2024

@janamkhatiwada Is it possible to enhance this feature for a general implementation of OAuth? Described in #75 this feature is requested by some people (and myself). This would establish openvpn-ui to a mentionable competitor against enterprise vpn solutions with a user portal and would be interesting for companies.

I would support this but i can't write GO code.

I would be glad to add it. but have new interesting project on my main job, which soaks all my time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants