diff --git a/docs/en_US/oauth2.rst b/docs/en_US/oauth2.rst index dadda732a16..10cec8b9087 100644 --- a/docs/en_US/oauth2.rst +++ b/docs/en_US/oauth2.rst @@ -63,7 +63,7 @@ and secure. "OAUTH2_API_BASE_URL", "Oauth2 base URL endpoint to make requests simple, ex: *https://api.github.com/*" "OAUTH2_USERINFO_ENDPOINT", "User Endpoint, ex: *user* (for github, or *user/emails* if the user's email address is private) and *userinfo* (for google). **For OIDC providers**, this is optional if the ID token contains sufficient claims (email, preferred_username, or sub)." "OAUTH2_SCOPE", "Oauth scope, ex: 'openid email profile'. **For OIDC providers**, include 'openid' scope to receive an ID token." - "OAUTH2_ICON", "The Font-awesome icon to be placed on the oauth2 button, ex: fa-github" + "OAUTH2_ICON", "The Font Awesome icon to be placed on the oauth2 button. A brand icon name (e.g. fa-github) uses the brands style by default; to use another style, include the style class explicitly (e.g. 'fas fa-key')." "OAUTH2_BUTTON_COLOR", "Oauth2 button color" "OAUTH2_USERNAME_CLAIM", "The claim which is used for the username. If the value is empty, **for OIDC providers** pgAdmin will use: 1) email, 2) preferred_username, or 3) sub (in that order). **For OAuth2 providers** without OIDC, email is required. Ex: *oid* (for AzureAD), *email* (for Github), *preferred_username* (for Keycloak)" "OAUTH2_AUTO_CREATE_USER", "Set the value to *True* if you want to automatically diff --git a/docs/en_US/release_notes_9_16.rst b/docs/en_US/release_notes_9_16.rst index a7ec92e1bee..cc0e1812bd2 100644 --- a/docs/en_US/release_notes_9_16.rst +++ b/docs/en_US/release_notes_9_16.rst @@ -20,6 +20,8 @@ Bundled PostgreSQL Utilities New features ************ + | `Issue #7641 `_ - Allow the OAuth2 login button icon to use any Font Awesome style (e.g. ``fas fa-key``), not only brand icons. + Housekeeping ************ diff --git a/web/pgadmin/static/js/SecurityPages/LoginPage.jsx b/web/pgadmin/static/js/SecurityPages/LoginPage.jsx index 7e11537482a..a91d82f6f48 100644 --- a/web/pgadmin/static/js/SecurityPages/LoginPage.jsx +++ b/web/pgadmin/static/js/SecurityPages/LoginPage.jsx @@ -46,9 +46,16 @@ export default function LoginPage({userLanguage, langOptions, forgotPassUrl, csr } {authSources?.includes?.(authSourcesEnum.OAUTH2) && oauth2Config.map((oauth)=>{ + // Allow the configured icon to specify its own Font Awesome style + // (e.g. 'fas fa-key'). Default to the brands style ('fab') when + // only an icon name is given, for backward compatibility. + const iconStyles = ['fab', 'fas', 'far', 'fal', 'fat', 'fad', + 'fa-brands', 'fa-solid', 'fa-regular', 'fa-light', 'fa-thin', 'fa-duotone']; + const hasStyle = oauth.OAUTH2_ICON?.split(/\s+/).some((c)=>iconStyles.includes(c)); + const iconClassName = hasStyle ? oauth.OAUTH2_ICON : 'fab '+oauth.OAUTH2_ICON; return ( - {gettext('Login with %s', oauth.OAUTH2_DISPLAY_NAME)} + {gettext('Login with %s', oauth.OAUTH2_DISPLAY_NAME)} ); })