Skip to content

Commit 5ae710b

Browse files
CopilotvharsekoCopilot
authored
docs: Add SOCIAL_PROVIDERS authentication module documentation (#138)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com> Co-authored-by: Valery Kharseko <vharseko@3a-systems.ru> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 715c518 commit 5ae710b

2 files changed

Lines changed: 106 additions & 0 deletions

File tree

openidm-doc/src/main/asciidoc/integrators-guide/appendix-auth-modules.adoc

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,67 @@ a|authentication.json
291291
|===
292292
In general, if you add a custom property, the Admin UI writes changes to the `authentication.json` or `ui-configuration.json` files.
293293
294+
[#social-providers-module-details]
295+
=== SOCIAL_PROVIDERS Module Configuration Options
296+
297+
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.
298+
299+
[NOTE]
300+
======
301+
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.
302+
======
303+
304+
[#social-providers-module-prop-basic]
305+
.SOCIAL_PROVIDERS Module Basic Properties
306+
[cols="18%,27%,27%,28%"]
307+
|===
308+
|Admin UI Label |Default |Description |Configuration File
309+
310+
a|Module Enabled
311+
a|true
312+
a|Controls whether the meta-module activates and generates child modules. If set to `false`, no social provider auth modules are generated.
313+
a|authentication.json
314+
315+
a|Default User Roles
316+
a|openidm-authorized
317+
a|List of roles inherited by all generated `OAUTH` and `OPENID_CONNECT` modules.
318+
a|authentication.json
319+
320+
a|Method for Determining Roles
321+
a|User Roles Property
322+
a|How authorization roles are resolved. When set to `User Roles Property`, the value of the User Roles Property field is used as the attribute name on the managed object.
323+
a|authentication.json
324+
325+
a|User Roles Property
326+
a|authzRoles
327+
a|The managed-object attribute used for authorization roles. Applies when Method for Determining Roles is set to `User Roles Property`.
328+
a|authentication.json
329+
330+
|===
331+
332+
[#social-providers-module-prop-advanced]
333+
.SOCIAL_PROVIDERS Module Advanced Properties
334+
[cols="18%,27%,27%,28%"]
335+
|===
336+
|Admin UI Label |Default |Description |Configuration File
337+
338+
a|Use Query ID
339+
a|(blank)
340+
a|A defined `queryId` searches against the `queryOnResource` endpoint. Leave blank to use `action=reauthenticate`.
341+
a|authentication.json
342+
343+
a|Augment Security Context — Type
344+
a|Javascript
345+
a|Script language for the augment security context script. Supports `Javascript` or `Groovy`.
346+
a|authentication.json
347+
348+
a|Augment Security Context — File Path
349+
a|auth/populateAsManagedUserFromRelationship.js
350+
a|Path to the security context script, relative to the `bin/defaults/script` directory. This script is inherited by all generated `OAUTH` and `OPENID_CONNECT` modules.
351+
a|authentication.json
352+
353+
|===
354+
294355
[#openid-connect-module-details]
295356
=== OPENID_CONNECT Module Configuration Options
296357

openidm-doc/src/main/asciidoc/integrators-guide/chap-auth.adoc

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,51 @@ Set up logins with OpenAM, to work with the related login session cookie, known
480480
IWA::
481481
The IWA module enables users to authenticate by using Integrated Windows Authentication (IWA), rather than by providing a username and password. For information about configuring the IWA module with OpenIDM, see xref:#openidm-auth-kerberos["Configuring IWA Authentication"].
482482
483+
[[social-providers-module]]SOCIAL_PROVIDERS::
484+
The `SOCIAL_PROVIDERS` module is a __meta-module__ (template) that bridges the social identity provider configuration in `conf/identityProviders.json` and the OpenIDM authentication filter. It is not an authenticator itself — instead, at startup it scans all providers registered with the `IdentityProviderService`, removes itself from the active module list, and dynamically generates the corresponding `OPENID_CONNECT` or `OAUTH` authentication modules:
485+
486+
+
487+
* For each provider of type `OPENID_CONNECT`, an `OPENID_CONNECT` auth module is generated with `openIdConnectHeader: "authToken"`.
488+
* For each provider of type `OAUTH`, an `OAUTH` auth module is generated with `authTokenHeader: "authToken"` and `authResolverHeader: "provider"`.
489+
490+
+
491+
The generated modules inherit the `augmentSecurityContext`, `propertyMapping`, and `defaultUserRoles` values from the `SOCIAL_PROVIDERS` template entry.
492+
493+
+
494+
Providers are configured separately in `conf/identityProviders.json`, or via the Admin UI under *Configure > Social ID Providers*. The `SOCIAL_PROVIDERS` module acts as a single configuration point so that operators do not need to add individual `OPENID_CONNECT` or `OAUTH` entries to `authentication.json` for every social provider.
495+
496+
+
497+
[NOTE]
498+
======
499+
Any `OPENID_CONNECT` or `OAUTH` modules that are __explicitly__ defined in `authentication.json` are independent of `SOCIAL_PROVIDERS` and will coexist alongside the dynamically generated modules. They are not managed or removed by `SOCIAL_PROVIDERS`.
500+
======
501+
502+
+
503+
A sample `SOCIAL_PROVIDERS` configuration is as follows:
504+
+
505+
[source, json]
506+
----
507+
{
508+
"name" : "SOCIAL_PROVIDERS",
509+
"enabled" : true,
510+
"properties" : {
511+
"augmentSecurityContext": {
512+
"type" : "text/javascript",
513+
"file" : "auth/populateAsManagedUserFromRelationship.js"
514+
},
515+
"propertyMapping" : {
516+
"userRoles" : "authzRoles"
517+
},
518+
"defaultUserRoles" : [
519+
"openidm-authorized"
520+
]
521+
}
522+
}
523+
----
524+
525+
+
526+
For detailed property options, see xref:appendix-auth-modules.adoc#social-providers-module-details["SOCIAL_PROVIDERS Module Configuration Options"].
527+
483528
[#openid-connect-module]
484529
OPENID_CONNECT::
485530
The `OPENID_CONNECT` module authenticates users via an OpenID Connect 1.0 provider. It reads an OpenID Connect ID token (JWT) from an HTTP header (configured via `openIdConnectHeader`), validates it against the configured OIDC provider endpoints, and maps the authenticated identity to an OpenIDM managed object.

0 commit comments

Comments
 (0)