Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkbox to enabled sharing federated token #5969

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ interface IdentityProviderSettingsPropsInterface extends TestableComponentInterf

const OIDC_CLIENT_ID_SECRET_MAX_LENGTH: number = 100;
const URL_MAX_LENGTH: number = 2048;
const SHARE_FEDERATED_TOKEN: string = "ShareFederatedToken";
/**
* The backend response includes both of the following keys
* for different connections.
Expand Down Expand Up @@ -1001,6 +1002,31 @@ export const AuthenticatorSettings: FunctionComponent<IdentityProviderSettingsPr

authenticator.meta.properties.push(logoutUrlMeta);
}

// Sharing federated token is allowed only for the OIDC connections.
if (!authenticator.meta.properties?.find(
(prop: CommonPluggableComponentMetaPropertyInterface) => prop.key === SHARE_FEDERATED_TOKEN)) {

const shareFederatedTokenData: CommonPluggableComponentPropertyInterface = {
key: SHARE_FEDERATED_TOKEN
};

authenticator.data.properties.push(shareFederatedTokenData);

const shareFederatedTokenMeta: CommonPluggableComponentMetaPropertyInterface = {
description: t("authenticationProvider:edit.oidc.shareFederatedToken.description"),
displayName: t("authenticationProvider:edit.oidc.shareFederatedToken.displayName"),
displayOrder: 20,
isConfidential: false,
isMandatory: false,
key: SHARE_FEDERATED_TOKEN,
options: [],
subProperties: [],
type: "boolean"
};

authenticator.meta.properties.push(shareFederatedTokenMeta);
}
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ export interface AuthenticationProviderNS {
tabName: string;
};
};
oidc: {
shareFederatedToken:{
description: string;
displayName: string;
};
};
};
forms: {
advancedConfigs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ export const authenticationProvider:AuthenticationProviderNS = {
smsProvider:{
tabName: "SMS Provider <1>(Coming Soon)</1>"
}
},
oidc: {
shareFederatedToken:{
displayName: "Share the federated access token with the applications.",
description: "Enable to the share the access token issued by the third-party connection with the applications."
}
}
},
forms: {
Expand Down
Loading