Skip to content

Commit

Permalink
[#3283] Update config builder for OIDC auth
Browse files Browse the repository at this point in the history
  • Loading branch information
iperdomo committed Mar 23, 2020
1 parent b0c269c commit 33b74de
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,16 @@ public static void main(String[] args) throws Exception {
String emailTo = cli.getOptionValue("et");
String orgName = cli.getOptionValue("on");
String signingKey = cli.getOptionValue("sk");
String oidcDomain = cli.getOptionValue("oidcDomain");
String oidcClientId = cli.getOptionValue("oidcClientId");
String oidcClientSecret = cli.getOptionValue("oidcClientSecret");
String emailHost = cli.getOptionValue("emailHost");
String emailPort = cli.getOptionValue("emailPort");
String emailUser = cli.getOptionValue("emailUser");
String emailPassword = cli.getOptionValue("emailPassword");
String sentryDSN = cli.getOptionValue("sentryDSN");


File configFileHome = new File(outFolder);

if (! configFileHome.exists()) { configFileHome.mkdirs(); }
Expand Down Expand Up @@ -243,12 +247,16 @@ public static void main(String[] args) throws Exception {
webData.put("emailTo", emailTo);
webData.put("organization", orgName);
webData.put("signingKey", signingKey);
webData.put("oidcDomain", oidcDomain);
webData.put("oidcClientId", oidcClientId);
webData.put("oidcClientSecret", oidcClientSecret);
webData.put("emailHost", emailHost);
webData.put("emailPort", emailPort);
webData.put("emailUser", emailUser);
webData.put("emailPassword", emailPassword);
webData.put("sentryDSN", sentryDSN);


Template t5 = cfg.getTemplate("appengine-web.xml.ftl");
t5.process(webData, new FileWriter(new File(configFileHome, "/appengine-web.xml")));

Expand Down Expand Up @@ -372,6 +380,18 @@ private static Options getOptions() {
signingKey.setArgs(1);
signingKey.setRequired(true);

Option oidcDomain = new Option("oidcDomain", "ODIC IdP domain");
oidcDomain.setArgs(1);
oidcDomain.setRequired(true);

Option oidcClientId = new Option("oidcClientId", "OIDC Client ID");
oidcClientId.setArgs(1);
oidcClientId.setRequired(true);

Option oidcClientSecret = new Option("oidcClientSecret", "OIDC Client Secret");
oidcClientSecret.setArgs(1);
oidcClientSecret.setRequired(true);

options.addOption(orgName);
options.addOption(awsId);
options.addOption(awsSecret);
Expand All @@ -392,6 +412,9 @@ private static Options getOptions() {
options.addOption(hereMapsAppCode);
options.addOption(alias);
options.addOption(signingKey);
options.addOption(oidcDomain);
options.addOption(oidcClientId);
options.addOption(oidcClientSecret);

return options;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
<property name="eventNotification" value="${eventNotification}" />
<property name="hereMapsAppId" value="${hereMapsAppId}" />
<property name="hereMapsAppCode" value="${hereMapsAppCode}" />
<property name="oidcDomain" value="${oidcDomain}" />
<property name="oidcClientId" value="${oidcClientId}" />
<property name="oidcClientSecret" value="${oidcClientSecret}" />
<property name="emailHost" value="${emailHost}" />
<property name="emailPort" value="${emailPort}" />
<property name="emailUser" value="${emailUser}" />
Expand Down

0 comments on commit 33b74de

Please # to comment.