Skip to content

Commit

Permalink
Update JAXRSConfiguration with Okta IDP setup
Browse files Browse the repository at this point in the history
Added Okta Identity Provider (IDP) setup in JAXRSConfiguration.java, enabling SAML error messages to be logged correctly when fields are missing. Also, irrelevant Okta client secret
  • Loading branch information
Gcolon021 committed Jan 18, 2024
1 parent 1d20ca0 commit 9e4656c
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ public class JAXRSConfiguration extends Application {

@Resource(mappedName = "java:global/client_id")
public static String clientId;

@Resource(mappedName = "java:global/client_secret")
public static String clientSecret;
public static String clientSecret; // actually picsure_client_secret in standalone.xml
@Resource(mappedName = "java:global/clientSecretIsBase64")
public static String clientSecretIsBase64;

Expand Down Expand Up @@ -102,8 +103,6 @@ public class JAXRSConfiguration extends Application {
public static String fence_harmonized_consent_group_concept_path;
public static String fence_topmed_consent_group_concept_path;
public static String fence_allowed_query_types;
public static String oktaClientSecret;
public static String oktaClientId;

public static String defaultAdminRoleName = "PIC-SURE Top Admin";

Expand Down Expand Up @@ -260,6 +259,19 @@ public void checkIDPProvider(Context ctx) {
logger.error("checkIDPProvider() Invalid FENCE IDP Provider Setup. Mandatory fields are missing. " +
"Check configuration in standalone.xml");
}
} else if (idp_provider.equalsIgnoreCase("okta")) {
try {
idp_provider_uri = (String) ctx.lookup("java:global/idp_provider_uri");
clientSecret = (String) ctx.lookup("java:global/sp_client_secret");
logger.debug("checkIDPProvider() idp provider OKTA is configured");
} catch (Exception ex) {
logger.error("checkIDPProvider() " + ex.getMessage());
logger.error("checkIDPProvider() Invalid OKTA IDP Provider Setup. Mandatory fields are missing. " +
"Check configuration in standalone.xml");
}
} else {
logger.error("checkIDPProvider() Invalid IDP Provider Setup. Mandatory fields are missing. " +
"Check configuration in standalone.xml");
}
logger.debug("checkIDPProvider() finished");

Expand Down

0 comments on commit 9e4656c

Please sign in to comment.