Skip to content

Commit

Permalink
Merge pull request #117 from correctexam/develop
Browse files Browse the repository at this point in the history
Provide a clear config prooperty for shiboleth redirect
  • Loading branch information
barais authored Jan 10, 2024
2 parents 60094be + 9e4550d commit 7a05f0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/fr/istic/web/rest/ShibAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import fr.istic.service.AuthenticationService;
import fr.istic.service.UserService;
import io.quarkus.security.runtime.QuarkusSecurityIdentity;

import org.eclipse.microprofile.config.inject.ConfigProperties;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -29,6 +32,9 @@ public class ShibAuth {
final String shibbolethLastName = "sn";
final String shibbolethFirstName = "givenName";

@ConfigProperty(name="correctexam.shib.redirect.address",defaultValue = "https://correctexam-test.univ-rennes.fr?shib=true")
private String shibAdressRedirect;

@Inject
public ShibAuth(AuthenticationService authenticationService, TokenProvider tokenProvider, UserService userService, HttpServletRequest request) {
this.authenticationService = authenticationService;
Expand All @@ -53,7 +59,7 @@ public Response askForRedirection()
{
log.debug("SHIB REDIRECTION");
logHeadersShib();
return Response.seeOther(URI.create("https://correctexam-test.univ-rennes.fr?shib=true")).build();
return Response.seeOther(URI.create(shibAdressRedirect)).build();
}

@GET
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ application.name=correctExam
%dev.quarkus.datasource.password=test
%dev.quarkus.hibernate-orm.log.sql=false
%dev.quarkus.http.port=8082
%dev.correctexam.shib.redirect.address = https://correctexam-test.univ-rennes.fr?shib=true

configcas.server_cas = https://sso-cas6-test.univ-rennes1.fr
configcas.domain_service = https://correctexam-test.univ-rennes.fr
Expand All @@ -17,6 +18,7 @@ quarkus.liquibase.migrate-at-start=false
%alone.quarkus.liquibase.migrate-at-start=true
%alone.quarkus.hibernate-orm.second-level-caching-enabled=false
%alone.correctexam.uses3=true
%alone.correctexam.shib.redirect.address = https://correctexam-test.univ-rennes.fr?shib=true
%alone.jhipster.mail.base-url=http://127.0.0.1:8080
%alone.quarkus.datasource.db-kind=h2
%alone.quarkus.datasource.jdbc.url=jdbc:h2:file:./mydb
Expand All @@ -34,6 +36,7 @@ quarkus.liquibase.migrate-at-start=false
%prod.quarkus.datasource.password=test
%prod.quarkus.liquibase.migrate-at-start=false
%prod.quarkus.liquibase.change-log=config/liquibase/master.xml
%prod.correctexam.shib.redirect.address = https://correctexam-test.univ-rennes.fr?shib=true


#mysql
Expand Down Expand Up @@ -179,6 +182,7 @@ quarkus.minio.url=http://localhost:9000
quarkus.minio.access-key=admin
quarkus.minio.secret-key=minioadmin
quarkus.minio.allow-empty=false

correctexam.bucketname=test
correctexam.uses3=true
correctexam.saveasfile=false
Expand Down

0 comments on commit 7a05f0b

Please sign in to comment.