diff --git a/src/bin/build-keycloak-theme/generateFtl/register.ftl b/src/bin/build-keycloak-theme/generateFtl/register.ftl index 1008f865..30268162 100644 --- a/src/bin/build-keycloak-theme/generateFtl/register.ftl +++ b/src/bin/build-keycloak-theme/generateFtl/register.ftl @@ -185,5 +185,59 @@ return out; })(), + "social": { + "displayInfo": (function (){ + <#attempt> + return ${social.displayInfo?c}; + <#recover> + + })(), + "providers": (()=>{ + + <#attempt> + <#if social.providers??> + + var out= []; + + <#attempt> + <#list social.providers as p> + out.push({ + "loginUrl": (function (){ + <#attempt> + return "${p.loginUrl?no_esc}"; + <#recover> + + })(), + "alias": (function (){ + <#attempt> + return "${p.alias}"; + <#recover> + + })(), + "providerId": (function (){ + <#attempt> + return "${p.providerId}"; + <#recover> + + })(), + "displayName": (function (){ + <#attempt> + return "${p.displayName}"; + <#recover> + + })() + }); + + <#recover> + + + return out; + + + <#recover> + + + })() + } } \ No newline at end of file diff --git a/src/lib/kcContext.ts b/src/lib/kcContext.ts index fb54c368..76a43195 100644 --- a/src/lib/kcContext.ts +++ b/src/lib/kcContext.ts @@ -130,6 +130,15 @@ export declare namespace KcContext { * (https://github.com/micedre/keycloak-mail-whitelisting) */ authorizedMailDomains?: string[]; + social: { + displayInfo: boolean; + providers?: { + loginUrl: string; + alias: string; + providerId: string; + displayName: string; + }[] + }; }; export type Info = Common & { diff --git a/src/lib/kcContextMocks/kcContextMocks.ts b/src/lib/kcContextMocks/kcContextMocks.ts index 16a85c12..7917ea5e 100644 --- a/src/lib/kcContextMocks/kcContextMocks.ts +++ b/src/lib/kcContextMocks/kcContextMocks.ts @@ -168,7 +168,10 @@ export const kcRegisterContext: KcContext.Register = { "*.yet-another-example.com", "*.example.com", "hello-world.com" - ] + ], + "social": { + "displayInfo": true + }, }; export const kcInfoContext: KcContext.Info = {