docs: Add SOCIAL_PROVIDERS authentication module documentation#138
docs: Add SOCIAL_PROVIDERS authentication module documentation#138
Conversation
Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenIDM/sessions/3944cb7f-c90a-4d2d-808d-eb5d83e59389 Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds Integrators Guide documentation for the SOCIAL_PROVIDERS authentication meta-module, explaining how it generates OPENID_CONNECT/OAUTH modules dynamically from configured identity providers.
Changes:
- Documented
SOCIAL_PROVIDERSin the “Supported Authentication Modules” list, including behavior, caveats, and a sampleauthentication.jsonentry. - Added an appendix section describing
SOCIAL_PROVIDERSconfiguration options and inherited properties.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| openidm-doc/src/main/asciidoc/integrators-guide/chap-auth.adoc | Adds a new SOCIAL_PROVIDERS entry describing startup generation behavior and linking to appendix details. |
| openidm-doc/src/main/asciidoc/integrators-guide/appendix-auth-modules.adoc | Adds a new section documenting SOCIAL_PROVIDERS properties and how they apply to generated modules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
openidm-doc/src/main/asciidoc/integrators-guide/appendix-auth-modules.adoc
Outdated
Show resolved
Hide resolved
…modules.adoc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| a|Module Enabled | ||
| a|Controls whether the meta-module activates and generates child modules. If set to `false`, no social provider auth modules are generated. If omitted, it defaults to `true`. | ||
|
|
||
| a|`augmentSecurityContext` |
There was a problem hiding this comment.
These entries read like top-level authentication module properties, but the example configuration places them under the module’s properties object. To prevent misconfiguration, clarify the expected JSON paths (for example properties.augmentSecurityContext, properties.propertyMapping.userRoles, properties.defaultUserRoles) or add a short sentence above the table stating that these keys are under the module’s properties section.
| a|Augment Security Context | ||
| a|Script inherited by all generated `OAUTH` and `OPENID_CONNECT` modules. Typically set to `auth/populateAsManagedUserFromRelationship.js`. | ||
|
|
||
| a|`propertyMapping.userRoles` |
There was a problem hiding this comment.
These entries read like top-level authentication module properties, but the example configuration places them under the module’s properties object. To prevent misconfiguration, clarify the expected JSON paths (for example properties.augmentSecurityContext, properties.propertyMapping.userRoles, properties.defaultUserRoles) or add a short sentence above the table stating that these keys are under the module’s properties section.
| a|User Roles | ||
| a|Attribute used for authorization roles, inherited by all generated modules. Usually set to `authzRoles`. | ||
|
|
||
| a|`defaultUserRoles` |
There was a problem hiding this comment.
These entries read like top-level authentication module properties, but the example configuration places them under the module’s properties object. To prevent misconfiguration, clarify the expected JSON paths (for example properties.augmentSecurityContext, properties.propertyMapping.userRoles, properties.defaultUserRoles) or add a short sentence above the table stating that these keys are under the module’s properties section.
| [#social-providers-module] | ||
| SOCIAL_PROVIDERS:: |
There was a problem hiding this comment.
For more reliable cross-referencing in AsciiDoc description lists, consider attaching the anchor directly to the term (e.g., [[social-providers-module]]SOCIAL_PROVIDERS::) rather than using a block attribute line. This avoids ambiguity about whether the anchor targets the list block vs. the specific list item.
| [#social-providers-module] | |
| SOCIAL_PROVIDERS:: | |
| [[social-providers-module]]SOCIAL_PROVIDERS:: |
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenIDM/sessions/e0d0820c-5ea9-4358-a13c-505e1620cae6 Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com>
Applied all review feedback in f671e6d:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| The `SOCIAL_PROVIDERS` module is a meta-module (template) that dynamically generates `OPENID_CONNECT` and `OAUTH` authentication modules at startup, one for each provider registered in the `IdentityProviderService`. The identity provider configurations themselves (client IDs, client secrets, authorization endpoints, etc.) are defined in `conf/identityProviders.json`, not inside the `SOCIAL_PROVIDERS` module entry. | ||
|
|
||
| [NOTE] | ||
| ====== | ||
| The `SOCIAL_PROVIDERS` entry is removed from the active authentication module list at startup — it is never initialized as an authenticator itself. Each provider entry in `conf/identityProviders.json` results in exactly one generated `OPENID_CONNECT` or `OAUTH` module. |
There was a problem hiding this comment.
“Each provider entry … results in exactly one generated OPENID_CONNECT or OAUTH module” is too strong as written unless all possible provider entries are guaranteed to be only those two types. To avoid documenting incorrect behavior, constrain this to supported provider types (for example: “each OPENID_CONNECT/OAUTH provider entry…”) or document what happens for unsupported provider types (ignored, error, etc.).
| The `SOCIAL_PROVIDERS` module is a meta-module (template) that dynamically generates `OPENID_CONNECT` and `OAUTH` authentication modules at startup, one for each provider registered in the `IdentityProviderService`. The identity provider configurations themselves (client IDs, client secrets, authorization endpoints, etc.) are defined in `conf/identityProviders.json`, not inside the `SOCIAL_PROVIDERS` module entry. | |
| [NOTE] | |
| ====== | |
| The `SOCIAL_PROVIDERS` entry is removed from the active authentication module list at startup — it is never initialized as an authenticator itself. Each provider entry in `conf/identityProviders.json` results in exactly one generated `OPENID_CONNECT` or `OAUTH` module. | |
| The `SOCIAL_PROVIDERS` module is a meta-module (template) that dynamically generates `OPENID_CONNECT` and `OAUTH` authentication modules at startup for supported providers registered in the `IdentityProviderService`. The identity provider configurations themselves (client IDs, client secrets, authorization endpoints, etc.) are defined in `conf/identityProviders.json`, not inside the `SOCIAL_PROVIDERS` module entry. | |
| [NOTE] | |
| ====== | |
| The `SOCIAL_PROVIDERS` entry is removed from the active authentication module list at startup — it is never initialized as an authenticator itself. For each identity provider entry in `conf/identityProviders.json` that is configured as an `OPENID_CONNECT` or `OAUTH` provider, the system generates exactly one corresponding authentication module. |
|
|
||
| [NOTE] | ||
| ====== | ||
| The `SOCIAL_PROVIDERS` entry is removed from the active authentication module list at startup — it is never initialized as an authenticator itself. Each provider entry in `conf/identityProviders.json` results in exactly one generated `OPENID_CONNECT` or `OAUTH` module. |
There was a problem hiding this comment.
“Each provider entry … results in exactly one generated OPENID_CONNECT or OAUTH module” is too strong as written unless all possible provider entries are guaranteed to be only those two types. To avoid documenting incorrect behavior, constrain this to supported provider types (for example: “each OPENID_CONNECT/OAUTH provider entry…”) or document what happens for unsupported provider types (ignored, error, etc.).
| The `SOCIAL_PROVIDERS` entry is removed from the active authentication module list at startup — it is never initialized as an authenticator itself. Each provider entry in `conf/identityProviders.json` results in exactly one generated `OPENID_CONNECT` or `OAUTH` module. | |
| The `SOCIAL_PROVIDERS` entry is removed from the active authentication module list at startup — it is never initialized as an authenticator itself. Each `OPENID_CONNECT` or `OAUTH` provider entry in `conf/identityProviders.json` results in exactly one generated authentication module. |
|
@copilot apply changes based on the comments in this thread |
…provider types Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenIDM/sessions/dbc5231b-07b7-45f1-acd9-c7a51f169d7e Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com>
Applied in 4e069b0. The intro now says "for supported providers" and the NOTE now reads "Each |
…format Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenIDM/sessions/0d5f0a99-7121-43ad-a3ff-38f16446f70d Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com>
…ormat Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenIDM/sessions/fcbb0f59-e5ac-4eb5-ba8a-e090fb33cfee Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenIDM/sessions/a70565dd-dbc0-4751-8cf9-13f2579bcdc5 Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com>
Original prompt
Task
Add documentation for the
SOCIAL_PROVIDERSauthentication module to the integrators guide. This module is fully implemented in the codebase but is completely absent from the current documentation (chap-auth.adocandappendix-auth-modules.adoc).Background
The
SOCIAL_PROVIDERSmodule is implemented in:openidm-authnfilter/src/main/java/org/forgerock/openidm/auth/AuthenticationService.java— methodsgetSocialAuthTemplate()andamendAuthConfig()and inner classSocialAuthModuleConfigFactoryopenidm-authnfilter/src/test/resources/config/authentication.json— example configopenidm-identity-provider/src/main/java/org/forgerock/openidm/idp/impl/IdentityProviderService.java— the service that provides provider configurationsopenidm-identity-provider/src/main/java/org/forgerock/openidm/idp/config/ProviderConfig.java— provider configuration modeltranslation.json) describe it as:"Enables authentication for all defined social providers"How it works (from code analysis —
AuthenticationService.java)SOCIAL_PROVIDERSis a meta-module / template — it has no authentication implementation of its own. When OpenIDM starts and loadsauthentication.json:getSocialAuthTemplate()scansauthModulesfor an entry with"name": "SOCIAL_PROVIDERS"that isenabled: trueamendAuthConfig()is called: theSOCIAL_PROVIDERSentry is removed from the active module listIdentityProviderService(configured viaidentityProvider.json), a new auth module is dynamically generated using theSocialAuthModuleConfigFactory:OPENID_CONNECT→ anOPENID_CONNECTauth module is created withopenIdConnectHeader: "authToken"OAUTH→ anOAUTHauth module is created withauthTokenHeader: "authToken"andauthResolverHeader: "provider"augmentSecurityContext,propertyMapping, anddefaultUserRolesfrom theSOCIAL_PROVIDERStemplateThis design means operators only need to configure one
SOCIAL_PROVIDERSentry inauthentication.json, and add providers toidentityProvider.json— OpenIDM will automatically generate and activate the correspondingOAUTH/OPENID_CONNECTauth modules.Key properties of the
SOCIAL_PROVIDERSmodule template:enabled— must betruefor the meta-module to activateaugmentSecurityContext— script inherited by all generated modules (typicallyauth/populateAsManagedUserFromRelationship.js)propertyMapping.userRoles— inherited by generated modules (usuallyauthzRoles)defaultUserRoles— inherited by generated modules (usually["openidm-authorized"])Note:
SOCIAL_PROVIDERSdoes NOT haveresolvers,queryOnResource,openIdConnectHeader, orauthTokenHeaderin its own config — those are injected by the factory when generating child modules.Example configuration (from
authentication.jsontest resource):{ "name" : "SOCIAL_PROVIDERS", "enabled" : true, "properties" : { "augmentSecurityContext": { "type" : "text/javascript", "file" : "auth/populateAsManagedUserFromRelationship.js" }, "propertyMapping" : { "userRoles" : "authzRoles" }, "defaultUserRoles" : [ "openidm-authorized" ] } }The identity providers themselves are defined in a separate
conf/identityProviders.jsonfile (managed byIdentityProviderService). TheSOCIAL_PROVIDERSmodule acts as a bridge between that configuration and the authentication filter.Changes Required
1.
openidm-doc/src/main/asciidoc/integrators-guide/chap-auth.adocIn the section
[#supported-auth-modules]("Supported Authentication Modules"), add a new entry documenting theSOCIAL_PROVIDERSmodule. Recommended placement: before theOPENID_CONNECTandOAUTHentries, ideally afterIWA::.The documentation should clearly explain:
SOCIAL_PROVIDERSis a meta-module / template, not a standalone authenticatorIdentityProviderService, removes itself, generatesOPENID_CONNECTandOAUTHmodules dynamicallyconf/identityProviders.json(or via Admin UI under Configure > Social ID Providers)OPENID_CONNECTandOAUTHmodulesOPENID_CONNECT/OAUTHmodules inauthentication.jsonare NOT managed bySOCIAL_PROVIDERSand will coexist independently2.
openidm-doc/src/main/asciidoc/integrators-guide/appendix-auth-modules.adocAdd a new section with a properties table for the
SOCIAL_PROVIDERSmodule. The table ...This pull request was created from Copilot chat.
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.