19bb209899
* Bump react-i18next from 11.18.6 to 12.0.0 Bumps [react-i18next](https://github.com/i18next/react-i18next) from 11.18.6 to 12.0.0. - [Release notes](https://github.com/i18next/react-i18next/releases) - [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/react-i18next/compare/v11.18.6...v12.0.0) --- updated-dependencies: - dependency-name: react-i18next dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Fix type issues Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jon Koops <jonkoops@gmail.com>
69 lines
1.4 KiB
TypeScript
69 lines
1.4 KiB
TypeScript
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
|
|
import type { TFunction } from "i18next";
|
|
|
|
/**
|
|
* Checks if a client is intended to be used for authenticating a to a realm.
|
|
*/
|
|
export const isRealmClient = (client: ClientRepresentation) => !client.protocol;
|
|
|
|
/**
|
|
* Gets a human readable name for the specified protocol.
|
|
*/
|
|
export const getProtocolName = (t: TFunction<"clients">, protocol: string) => {
|
|
switch (protocol) {
|
|
case "openid-connect":
|
|
return t("clients:protocolTypes.openIdConnect");
|
|
case "saml":
|
|
return t("clients:protocolTypes.saml");
|
|
default:
|
|
return protocol;
|
|
}
|
|
|
|
return protocol;
|
|
};
|
|
|
|
export const defaultContextAttributes = [
|
|
{
|
|
key: "custom",
|
|
name: "Custom Attribute...",
|
|
custom: true,
|
|
},
|
|
{
|
|
key: "kc.identity.authc.method",
|
|
name: "Authentication Method",
|
|
values: [
|
|
{
|
|
key: "pwd",
|
|
name: "Password",
|
|
},
|
|
{
|
|
key: "otp",
|
|
name: "One-Time Password",
|
|
},
|
|
{
|
|
key: "kbr",
|
|
name: "Kerberos",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
key: "kc.realm.name",
|
|
name: "Realm",
|
|
},
|
|
{
|
|
key: "kc.time.date_time",
|
|
name: "Date/Time (MM/dd/yyyy hh:mm:ss)",
|
|
},
|
|
{
|
|
key: "kc.client.network.ip_address",
|
|
name: "Client IPv4 Address",
|
|
},
|
|
{
|
|
key: "kc.client.network.host",
|
|
name: "Client Host",
|
|
},
|
|
{
|
|
key: "kc.client.user_agent",
|
|
name: "Client/User Agent",
|
|
},
|
|
];
|