diff --git a/backend/go-app/main.go b/backend/go-app/main.go
index acfde3c4..59a4ce31 100755
--- a/backend/go-app/main.go
+++ b/backend/go-app/main.go
@@ -1131,9 +1131,9 @@ func checkAdminLogin(resp http.ResponseWriter, request *http.Request) {
}
// No childorg setup, only parent org
- if len(org.ManagerOrgs) > 0 || len(org.CreatorOrg) > 0 {
- continue
- }
+ // if len(org.ManagerOrgs) > 0 || len(org.CreatorOrg) > 0 {
+ // continue
+ // }
// Should run calculations
if len(org.SSOConfig.OpenIdAuthorization) > 0 {
diff --git a/frontend/src/components/Billing.jsx b/frontend/src/components/Billing.jsx
index 3f5327fb..ef6f350e 100644
--- a/frontend/src/components/Billing.jsx
+++ b/frontend/src/components/Billing.jsx
@@ -2446,4 +2446,4 @@ const Billing = (props) => {
)
}
-export default Billing;
+export default Billing;
\ No newline at end of file
diff --git a/frontend/src/components/NewHeader.jsx b/frontend/src/components/NewHeader.jsx
index 9da1a48a..a3ce311c 100644
--- a/frontend/src/components/NewHeader.jsx
+++ b/frontend/src/components/NewHeader.jsx
@@ -298,17 +298,21 @@ const Header = (props) => {
if (response.status !== 200) {
console.log("Error in response");
} else {
- localStorage.removeItem("apps")
- localStorage.removeItem("workflows")
- localStorage.removeItem("userinfo")
+ localStorage.removeItem("apps");
+ localStorage.removeItem("workflows");
+ localStorage.removeItem("userinfo");
}
return response.json();
})
.then(function (responseJson) {
- console.log("In here?")
+ console.log("In here?");
if (responseJson.success === true) {
- if (responseJson.region_url !== undefined && responseJson.region_url !== null && responseJson.region_url.length > 0) {
+ if (
+ responseJson.region_url !== undefined &&
+ responseJson.region_url !== null &&
+ responseJson.region_url.length > 0
+ ) {
console.log("Region Change: ", responseJson.region_url);
localStorage.setItem("globalUrl", responseJson.region_url);
//globalUrl = responseJson.region_url
@@ -317,20 +321,29 @@ const Header = (props) => {
if (responseJson["reason"] === "SSO_REDIRECT") {
toast.info("Redirecting to SSO login page as SSO is required for this organization.")
setTimeout(() => {
- window.location.href = responseJson["url"]
- return
- }, 2000)
+ toast.info(
+ "Redirecting to SSO login page as SSO is required for this organization."
+ );
+ window.location.href = responseJson["url"];
+ return;
+ }, 2000);
} else {
toast("Successfully changed active organization - refreshing!");
setTimeout(() => {
- window.location.reload()
+ window.location.reload();
}, 2000);
}
} else {
- if (responseJson.reason !== undefined && responseJson.reason !== null && responseJson.reason.length > 0) {
+ if (
+ responseJson.reason !== undefined &&
+ responseJson.reason !== null &&
+ responseJson.reason.length > 0
+ ) {
toast(responseJson.reason);
} else {
- toast("Failed changing org. Try again or contact support@shuffler.io if this persists.");
+ toast(
+ "Failed changing org. Try again or contact support@shuffler.io if this persists."
+ );
}
}
})
diff --git a/frontend/src/components/OrgHeaderexpanded.jsx b/frontend/src/components/OrgHeaderexpanded.jsx
index 1646efc9..efc40719 100644
--- a/frontend/src/components/OrgHeaderexpanded.jsx
+++ b/frontend/src/components/OrgHeaderexpanded.jsx
@@ -319,9 +319,71 @@ const OrgHeaderexpanded = (props) => {
);
- const toggleBetweenRequiredOrOptional = (event) => {
- setSSORequired(event.target.checked);
- };
+ const toggleBetweenRequiredOrOptional = (event) => {
+ if (
+ ssoEntrypoint === "" &&
+ openidAuthorization === "" &&
+ openidToken === ""
+ ) {
+ if (!SSORequired) {
+ toast.error(
+ "Please fill in fields for either OpenID connect or SSO before continuing. "
+ );
+ return;
+ }
+ } else {
+ toast.info("Toggled SSO. Remember to save.");
+ }
+
+ setSSORequired(event.target.checked);
+ };
+
+ const HandleTestSSO = () => {
+ const url = `${globalUrl}/api/v1/orgs/${selectedOrganization?.id}/change`;
+ const data = {
+ org_id: selectedOrganization?.id,
+ sso_test: true,
+ };
+
+ fetch(url, {
+ mode: "cors",
+ credentials: "include",
+ crossDomain: true,
+ method: "POST",
+ body: JSON.stringify(data),
+ withCredentials: true,
+ headers: {
+ "Content-Type": "application/json; charset=utf-8",
+ },
+ })
+ .then((response) => {
+ if (response.status !== 200) {
+ toast.error(
+ "Failed to test sso. Please try again later or contact support@shuffler.io if issue persist."
+ );
+ return;
+ }
+ return response.json();
+ })
+ .then((responjson) => {
+ if (responjson["reason"] === "SSO_REDIRECT") {
+ setTimeout(() => {
+ toast.info(
+ "Redirecting to SSO login page as SSO is required for this organization."
+ );
+ window.location.href = responjson["url"];
+ return;
+ }, 2000);
+ } else {
+ toast.error(
+ "No SSO found for this org. Please set up sso for this org."
+ );
+ }
+ })
+ .catch((err) => {
+ console.log("error for sso test is: ", err);
+ });
+ };
const HandleTestSSO = () => {
@@ -702,434 +764,476 @@ const OrgHeaderexpanded = (props) => {
SSO Configuration
-
- Make SAML SSO or OpenID Authentication Required or Optional for Your Organization.
-
-
- {SSORequired ? 'Required' : 'Optional'}
-
-
-
-
- You can test your SSO configuration by clicking the button below. Before testing, ensure you have set Open ID Connect or SAML SSO credentials.
-
- 0 ||
- ssoCertificate.length > 0 ||
- openidAuthorization.length > 0 ||
- openidClientId.length > 0
- )
- ? "Please ensure all SSO credentials are set before testing."
- : ""
- }
- >
-
-
-
-
-
+
+ Make SAML SSO or OpenID Authentication Required or Optional for Your
+ Organization.
+
+
+
+ {SSORequired ? "Required" : "Optional"}
+
+
+
+
+ You can test your SSO configuration by clicking the button below.
+ Before testing, ensure you have set Open ID Connect or SAML SSO
+ credentials.
+
+ 0 ||
+ ssoCertificate.length > 0 ||
+ openidAuthorization.length > 0 ||
+ openidClientId.length > 0
+ )
+ ? "Please ensure all SSO credentials are set before testing."
+ : ""
+ }
+ >
+
+
+
+
+