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 generic OAuth authentication support #252

Merged
merged 14 commits into from
Dec 23, 2023
Merged

Added generic OAuth authentication support #252

merged 14 commits into from
Dec 23, 2023

Conversation

sinamics
Copy link
Owner

@sinamics sinamics commented Dec 22, 2023

  • Add new env variables to configure the oauth
  • Show new oauth button if env is present.
  • Update documentation

Notes!

  • If user has registered to the application using credentails, we need to set the OAUTH_ALLOW_DANGEROUS_EMAIL_LINKING that will allow to merge the accounts.
  • If user signin using oauth and then set`s a password from the user-settings, he will be able to login using both credentials and oauth.

Tested with Keycloak, Google, Github and Discord

Keycloak Configuration

ztnet:
  image: sinamics/ztnet:latest
  ...
  environment:
    OAUTH_ID=your-client-id
    OAUTH_SECRET=your-client-secret
    OAUTH_ALLOW_DANGEROUS_EMAIL_LINKING=true
    OAUTH_WELLKNOWN="http://{PROVIDER_URL}/auth/realms/{REALM}/.well-known/openid-configuration"

GitHub Configuration

ztnet:
  image: sinamics/ztnet:latest
  ...
  environment:
    OAUTH_ID=your-github-client-id
    OAUTH_SECRET=your-github-client-secret
    OAUTH_ACCESS_TOKEN_URL="https://github.com/login/oauth/access_token"
    OAUTH_AUTHORIZATION_URL="https://github.com/login/oauth/authorize"
    OAUTH_USER_INFO="https://api.github.com/user"
    OAUTH_SCOPE="read:user user:email"

Resolves #168

@sinamics sinamics changed the title Added generic oauth authentication support Added generic OAuth authentication support Dec 22, 2023
@sinamics sinamics merged commit 7cb1952 into main Dec 23, 2023
2 checks passed
@sinamics sinamics deleted the oauth branch December 23, 2023 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: auth in web panel with SSO
1 participant