Skip to content

Commit 4f1c07b

Browse files
committed
Merge branch 'cslzchen/institution-sso' into feature/institution-sso
2 parents 92c11a2 + bc4d97d commit 4f1c07b

50 files changed

Lines changed: 2721 additions & 141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile-local

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ RUN mkdir -p ~/.gradle \
1313
&& ./gradlew --version;
1414

1515
RUN cd cas-overlay && ./gradlew clean build --parallel --no-daemon;
16-
# The build process above in docker may takes a long time depending on your local resources. This OK if you only use
16+
# The build process above in docker may take a long time depending on your local resources. This OK if you only use
1717
# CAS by building it once. For local development, building in local shell or with your IDE such as IntelliJ is much
18-
# faster. Afterwards, simply comment out the above "RUN" command and enable the following "COPY" one. In fact, this
19-
# stage can be skipped if you have the WAR built locally. Just need run the second stage with a modified WAR source.
18+
# faster. Afterwards, simply comment out the above "RUN" command above and enable the "COPY" one below.
2019
# COPY ./build cas-overlay/build/
2120

21+
# In fact, the above "overlay" stage can be skipped if you have the WAR built locally. Simply run this second stage
22+
# "cas" with a modified WAR source.
2223
FROM adoptopenjdk/openjdk11:alpine-jre AS cas
2324

2425
LABEL "Organization"="Center for Open Science"
@@ -33,9 +34,9 @@ RUN cd / \
3334
COPY etc/cas/ /etc/cas/
3435

3536
COPY etc/cas/config/ /etc/cas/config/
36-
# Use "cas-local.properties" and "log4j2-local.xml" for local development
37-
RUN rm etc/cas/config/cas.properties
37+
# Use "cas-local.properties", "instn-authn-local.xsl" and "log4j2-local.xml" for local development
3838
COPY etc/cas/config/local/cas-local.properties etc/cas/config/cas.properties
39+
COPY etc/cas/config/local/instn-authn-local.xsl etc/cas/config/instn-authn.xsl
3940
COPY etc/cas/config/local/log4j2-local.xml etc/cas/config/log4j2.xml
4041
RUN rm -r etc/cas/config/local
4142

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ dependencies {
123123

124124
// Google GSON
125125
implementation "com.google.code.gson:gson:${gsonVersion}"
126+
127+
// Javascript Object Signing and Encryption (JOSE) and JSON Web Tokens (JWT)
128+
implementation "com.nimbusds:nimbus-jose-jwt:${nimbusJoseVersion}"
129+
130+
// Apache HttpComponents Client fluent API
131+
implementation "org.apache.httpcomponents:fluent-hc:${fluentHcVersion}"
126132
}
127133

128134
tasks.findByName("jibDockerBuild")

docker-reload.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1-
#!/bin/bash
1+
#!/bin/zsh
22

33
# Rebuild locally and replace the WAR
4+
echo "######## Rebuild & Replace WAR ########"
5+
echo "./gradlew clean build"
46
./gradlew clean build
7+
echo "docker cp ./build/libs/cas.war cas:/cas-overlay"
58
docker cp ./build/libs/cas.war cas:/cas-overlay
9+
echo "################# Done ################"
610

711
# Sync configuration files
12+
echo "########## Sync Config Files ##########"
13+
echo "docker exec -d cas sh -c \"rm -rf /etc/cas/config/*\""
814
docker exec -d cas sh -c "rm -rf /etc/cas/config/*"
15+
echo "docker cp ./etc/cas/config/local/cas-local.properties cas:/etc/cas/config/cas.properties"
916
docker cp ./etc/cas/config/local/cas-local.properties cas:/etc/cas/config/cas.properties
17+
echo "docker cp ./etc/cas/config/local/instn-authn-local.xsl cas:/etc/cas/config/instn-authn.xsl"
18+
docker cp ./etc/cas/config/local/instn-authn-local.xsl cas:/etc/cas/config/instn-authn.xsl
19+
echo "docker cp ./etc/cas/config/local/log4j2-local.xml cas:/etc/cas/config/log4j2.xml"
1020
docker cp ./etc/cas/config/local/log4j2-local.xml cas:/etc/cas/config/log4j2.xml
21+
echo "################# Done ################"
1122

1223
# Sync JSON registered service files
24+
echo "####### Sync Service Definition #######"
25+
echo "docker exec -d cas sh -c \"rm -rf /etc/cas/services/*\""
1326
docker exec -d cas sh -c "rm -rf /etc/cas/services/*"
27+
echo "docker cp ./etc/cas/services/local/. cas:/etc/cas/services"
1428
docker cp ./etc/cas/services/local/. cas:/etc/cas/services
29+
echo "################# Done ################"
1530

1631
# Restart the container
32+
echo "########## Restart Container ##########"
33+
echo "docker restart cas"
1734
docker restart cas
35+
echo "docker logs -f --tail 0 cas"
36+
echo "####### OSF CAS LOG STARTS HERE #######"
1837
docker logs -f --tail 0 cas

etc/cas/config/cas.properties

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,46 @@ cas.logout.confirm-logout=false
6464
cas.logout.remove-descendant-tickets=false
6565
########################################################################################################################
6666

67+
########################################################################################################################
68+
# OSF URLs
69+
########################################################################################################################
70+
# OSF
71+
#
72+
cas.authn.osf-url.home=https://{{ .Values.osfDomain }}/
73+
cas.authn.osf-url.dashboard=https://{{ .Values.osfDomain }}/dashboard/
74+
cas.authn.osf-url.logout=https://{{ .Values.osfDomain }}/logout/
75+
cas.authn.osf-url.resend-confirmation=https://{{ .Values.osfDomain }}/resend/
76+
cas.authn.osf-url.forgot-password=https://{{ .Values.osfDomain }}/forgotpassword/
77+
cas.authn.osf-url.register=https://{{ .Values.osfDomain }}/register/
78+
cas.authn.osf-url.search=https://{{ .Values.osfDomain }}/search/
79+
cas.authn.osf-url.support=https://{{ .Values.osfDomain }}/support/
80+
cas.authn.osf-url.donate=https://www.cos.io/about/support-cos/
81+
#
82+
# OSF Products
83+
#
84+
cas.authn.osf-url.preprints-home=https://{{ .Values.osfDomain }}/preprints/
85+
cas.authn.osf-url.registries-home=https://{{ .Values.osfDomain }}/registries/
86+
cas.authn.osf-url.institutions-home=https://{{ .Values.osfDomain }}/institutions/
87+
cas.authn.osf-url.meetings-home=https://{{ .Values.osfDomain }}/meetings/
88+
########################################################################################################################
89+
90+
########################################################################################################################
91+
# OSF API Settings for Institution Authentication
92+
########################################################################################################################
93+
# Authentication Endpoint
94+
#
95+
cas.authn.osf-api.instn-authn-endpoint=https://{{ .Values.apiDomain }}/v2/institutions/auth/
96+
#
97+
# JWT / JWE secrets for signing and encrypting authentication request payload
98+
#
99+
cas.authn.osf-api.instn-authn-jwt-secret=${OSF_JWT_SECRET}
100+
cas.authn.osf-api.instn-authn-jwe-secret=${OSF_JWE_SECRET}
101+
#
102+
# Path of the XSL file for parsing and transforming XML authentication responses
103+
#
104+
cas.authn.osf-api.instn-authn-xsl-location=file:/etc/cas/config/instn-authn.xsl
105+
########################################################################################################################
106+
67107
########################################################################################################################
68108
# OSF PostgreSQL Authentication
69109
# See: https://apereo.github.io/cas/6.2.x/installation/Configuring-Custom-Authentication.html
@@ -204,13 +244,13 @@ cas.authn.pac4j.orcid.callback-url-type=QUERY_PARAMETER
204244
#
205245
# Delegation Client: CAS
206246
#
207-
cas.authn.pac4j.cas[0].login-url=https://accounts.staging.osf.io/login
208-
cas.authn.pac4j.cas[0].client-name=stage1cas
247+
cas.authn.pac4j.cas[0].login-url=https://bprdeis.cord.edu:8443/cas/login
248+
cas.authn.pac4j.cas[0].client-name=cord
209249
cas.authn.pac4j.cas[0].protocol=SAML
210250
cas.authn.pac4j.cas[0].callback-url-type=QUERY_PARAMETER
211251
#
212-
cas.authn.pac4j.cas[1].login-url=https://accounts.staging2.osf.io/login
213-
cas.authn.pac4j.cas[1].client-name=stage2cas
214-
cas.authn.pac4j.cas[1].protocol=CAS30
252+
cas.authn.pac4j.cas[1].login-url=https://stwcas.okstate.edu/cas/login
253+
cas.authn.pac4j.cas[1].client-name=okstate
254+
cas.authn.pac4j.cas[1].protocol=SAML
215255
cas.authn.pac4j.cas[1].callback-url-type=QUERY_PARAMETER
216256
########################################################################################################################

0 commit comments

Comments
 (0)