Skip to content

Commit

Permalink
feat: add oidc option for sso (#77)
Browse files Browse the repository at this point in the history
## Description

...

## Related Issue

Fixes #
<!-- or -->
Relates to #

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor Guide
Steps](https://github.com/defenseunicorns/uds-package-mattermost/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Co-authored-by: Wayne Starr <[email protected]>
  • Loading branch information
corang and Racer159 authored May 16, 2024
1 parent 4e45a92 commit 9228ee8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
18 changes: 17 additions & 1 deletion chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,34 @@ spec:
- "https://{{ .Values.subdomain }}.{{ .Values.domain }}/*"
defaultClientScopes:
- "openid"
{{ if eq .Values.sso.protocol "gitlab" }}
- "mapper-oidc-username-username"
- "mapper-oidc-mattermostid-id"
- "mapper-oidc-email-email"
- "mapper-oidc-email-email"
{{ 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

0 comments on commit 9228ee8

Please sign in to comment.