Orchardcore google

From CrestApps/CrestApps.AgentSkills · View interactive version

Orchardcore google is an AI agent skill from the GitHub repository CrestApps/CrestApps.AgentSkills. Skill for configuring Google integrations in Orchard Core. Covers Google Analytics, Google Tag Manager, Google Authentication, credentials configuration, current feature IDs, current admin paths, generic Settings recipes, ConfigureGoogleSettings with the OrchardCore Authentication Google configurati

How to use this skill

Skill file

Orchard Core Google Integration

The Google module has these feature IDs:

| Feature | ID | Current admin path |

|---|---|---|

| Google Analytics | OrchardCore.Google.Analytics | Settings → Integrations → Google Analytics |

| Google Tag Manager | OrchardCore.Google.TagManager | Settings → Integrations → Google Tag Manager |

| Google authentication | OrchardCore.Google.GoogleAuthentication | Settings → Security → Authentication → Google |

Google authentication depends on

OrchardCore.Users.ExternalAuthentication. Create an OAuth client (web

application) in the Google Cloud Console and register the callback URL; its

default path is /signin-google under the tenant. Google+ is not an Orchard

Core dependency or setup step.

The Google features use site settings, so use the generic Settings recipe

step:

{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "OrchardCore.Google.Analytics",
        "OrchardCore.Google.TagManager",
        "OrchardCore.Google.GoogleAuthentication"
      ]
    },
    {
      "name": "Settings",
      "GoogleAnalyticsSettings": {
        "TrackingID": "G-EXAMPLE"
      },
      "GoogleTagManagerSettings": {
        "ContainerID": "GTM-EXAMPLE"
      },
      "GoogleAuthenticationSettings": {
        "ClientID": "google-oauth-client-id.apps.googleusercontent.com",
        "CallbackPath": "/signin-google",
        "SaveTokens": false
      }
    }
  ]
}

The handler expects the stored ClientSecret to be data-protected, as it is

when saved from the admin page. A secret written by a recipe is stored as is

and fails to decrypt, so supply it through the admin page or configuration.

In 4.0, GoogleAuthenticationSettings.ClientSecretSecretName can name a

TextSecret of the Secrets module instead; it takes precedence over

ClientSecret. With the OrchardCore.Secrets feature enabled, the admin page

offers Use a secret (suggested name Google.ClientSecret), and a saved

secret can be moved without retyping it from **Tools → Security → Migrate

Secrets**. A recipe can create the secret with the Secrets step (value from

the OrchardCore__Secrets__Google.ClientSecret environment variable) and set

"ClientSecretSecretName": "Google.ClientSecret" in

GoogleAuthenticationSettings. See orchardcore-secrets.

Configuration Overrides

Call ConfigureGoogleSettings() on the OrchardCoreBuilder to override the

Google authentication settings from configuration:

builder.Services
    .AddOrchardCms()
    .ConfigureGoogleSettings();
{
  "OrchardCore": {
    "Authentication": {
      "Google": {
        "ClientID": "google-oauth-client-id.apps.googleusercontent.com",
        "ClientSecret": "plain-client-secret",
        "CallbackPath": "/signin-google",
        "SaveTokens": false
      }
    }
  }
}

ClientSecret is a plain value here, for example from the

OrchardCore__Authentication__Google__ClientSecret environment variable;

Orchard Core protects it before use. In 4.0 a configured ClientSecret logs a

LegacySecretConfiguration warning (event 8100). Because the section binds

onto GoogleAuthenticationSettings, set "ClientSecretSecretName": "Google.ClientSecret"

here instead to reference a secret, and remove ClientSecret.

Enable OrchardCore.Users.Registration only when a Google external login may

create a local Orchard user; new external users are governed by

ExternalRegistrationSettings (see orchardcore-users-roles).

Permissions

The static OrchardCore.Google.Permissions class holds

ManageGoogleAuthentication, ManageGoogleAnalytics, and

ManageGoogleTagManager; each feature registers its own provider. The removed

GoogleAnalyticsPermissionsProvider.ManageGoogleAnalytics member must be

replaced with OrchardCore.Google.Permissions.ManageGoogleAnalytics.

Upgrading from 3.x

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.