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(oidc): make OIDC endpoint runtime configurable #444

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 0 additions & 3 deletions .github/workflows/release-container-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ on:
required: true
TIMED_PROD_HOST:
required: true
OIDC_HOST:
required: true


jobs:
Expand Down Expand Up @@ -89,7 +87,6 @@ jobs:
AUTH_ROLE_CUSTOMER=${{ secrets.AUTH_ROLE_CUSTOMER }}
TIMED_STAGING_HOST=${{ secrets.TIMED_STAGING_HOST }}
TIMED_PROD_HOST=${{ secrets.TIMED_PROD_HOST }}
OIDC_HOST=${{ secrets.OIDC_HOST }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.prep.outputs.tags }}
labels: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,5 @@ jobs:
AUTH_ROLE_CUSTOMER: ${{ secrets.AUTH_ROLE_CUSTOMER }}
TIMED_STAGING_HOST: ${{ secrets.TIMED_STAGING_HOST }}
TIMED_PROD_HOST: ${{ secrets.TIMED_PROD_HOST }}
OIDC_HOST: ${{ secrets.OIDC_HOST }}


2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ARG AUTH_ROLE_EMPLOYEE
ARG AUTH_ROLE_CUSTOMER
ARG TIMED_STAGING_HOST
ARG TIMED_PROD_HOST
ARG OIDC_HOST
# Install dependencies.
RUN apk update && \
apk add --no-cache \
Expand Down Expand Up @@ -38,6 +37,7 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf
WORKDIR /usr/share/nginx/html

COPY ./docker-entrypoint.sh /
ENV OIDC_CLIENT_HOST https://sso.example.com/auth/realms/example/protocol/openid-connect
ENV OIDC_CLIENT cc

EXPOSE 80
Expand Down
5 changes: 1 addition & 4 deletions frontend/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ module.exports = function (environment) {

if (environment === "production") {
// Whether Stage or Prod, the OIDC host and client will stay the same
ENV["ember-simple-auth-oidc"].host = env(
"OIDC_HOST",
"http://timed.local/auth/realms/timed/protocol/openid-connect"
);
ENV["ember-simple-auth-oidc"].host = "sso-client-host";
ENV["ember-simple-auth-oidc"].clientId = "sso-client-id";
}

Expand Down
1 change: 1 addition & 0 deletions frontend/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ urlencode() {

sed -i \
-e "s/sso-client-id/$(urlencode ${OIDC_CLIENT})/g" \
-e "s/sso-client-host/$(urlencode ${OIDC_CLIENT_HOST})/g" \
/usr/share/nginx/html/index.html

exec "$@"
Loading