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

feat: add oidc option for sso #77

Merged
merged 7 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,34 @@ spec:
redirectUris:
- "https://{{ .Values.subdomain }}.{{ .Values.domain }}/*"
defaultClientScopes:
- "openid"
{{ if eq .Values.sso.protocol "gitlab" }}
corang marked this conversation as resolved.
Show resolved Hide resolved
- "mapper-oidc-username-username"
- "mapper-oidc-mattermostid-id"
- "mapper-oidc-email-email"
- "mapper-oidc-email-email"
corang marked this conversation as resolved.
Show resolved Hide resolved
{{ end }}
{{ if eq .Values.sso.protocol "openid_connect" }}
- "profile"
- "email"
{{ end }}

secretName: {{ .Values.sso.secretName }}
secretTemplate:
{{ if eq .Values.sso.protocol "gitlab" }}
MM_GITLABSETTINGS_ENABLE: "{{ .Values.sso.enabled | toString }}"
MM_GITLABSETTINGS_ID: "clientField(clientId)"
MM_GITLABSETTINGS_SECRET: "clientField(secret)"
MM_GITLABSETTINGS_AUTHENDPOINT: "https://sso.{{ .Values.domain }}/realms/uds/protocol/openid-connect/auth"
MM_GITLABSETTINGS_TOKENENDPOINT: "http://keycloak-http.keycloak.svc.cluster.local:8080/realms/uds/protocol/openid-connect/token"
MM_GITLABSETTINGS_USERAPIENDPOINT: "https://sso.{{ .Values.domain }}/realms/uds/protocol/openid-connect/userinfo"
{{ end }}
{{ if eq .Values.sso.protocol "openid_connect" }}
MM_OPENIDSETTINGS_ENABLE: "{{ .Values.sso.enabled | toString }}"
MM_OPENIDSETTINGS_BUTTONTEXT: "{{ .Values.sso.login_button_text }}"
MM_OPENIDSETTINGS_BUTTONCOLOR: "{{ .Values.sso.login_button_color }}"
MM_OPENIDSETTINGS_DISCOVERYENDPOINT: "https://sso.{{ .Values.domain }}/realms/uds/.well-known/openid-configuration"
MM_OPENIDSETTINGS_ID: "clientField(clientId)"
MM_OPENIDSETTINGS_SECRET: "clientField(secret)"
{{ end }}
MM_EMAILSETTINGS_ENABLESIGNUPWITHEMAIL: "{{ .Values.sso.enable_sign_up_with_email | toString }}"
MM_EMAILSETTINGS_ENABLESIGNINWITHEMAIL: "{{ .Values.sso.enable_sign_in_with_email | toString }}"
MM_EMAILSETTINGS_ENABLESIGNINWITHUSERNAME: "{{ .Values.sso.enable_sign_in_with_username | toString }}"
Expand Down
6 changes: 6 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ postgres:

sso:
enabled: true
# Options: "gitlab", "openid_connect"
protocol: "gitlab"
secretName: mattermost-sso

# These should typically be disabled if SSO is enabled
enable_sign_up_with_email: false
enable_sign_in_with_email: false
enable_sign_in_with_username: false

# Config for OIDC/SAML
login_button_text: "Login with SSO"
login_button_color: "#144A8F"

# The subdomain for the mattermost server, will be prefixed to your domain (ex: mattermost.example.com)
subdomain: "chat"

Expand Down