Build the OAuth2 client a remote proxy needs on the receiving tenant: client
credentials grant, client_secret_post, scope fr:idm:* and nothing
broader. The result is data, ready for frodo.oauth2oidc.client.createOAuth2Client;
it holds the secret in plain text, so hand it on and do not print or log it.
parameters
id of the client
secret of the client (at least 16 characters, see RemoteProxy.generateRemoteProxySecret)
Optionaldescription?: stringoptional description of the client
the OAuth2 client
Build the configuration of a remote proxy with bearer authentication to a
receiving tenant: the instance URL (with a trailing slash), the token
endpoint of the realm, client secret post, scope fr:idm:*, and the secret
as an ESV placeholder (&{esv.name}, derived from the id of the ESV secret
that holds it). It is the portable form: the secret never appears in the
configuration. The URLs name the receiving tenant, so a promotion would
carry them to the next environment unchanged; with hostVariableId they
hold an ESV placeholder instead of the host (https://&{esv.name}/openidm/)
and each environment resolves its own receiver.
parameters
id of the OAuth2 client on the receiving tenant
OptionalhostVariableId?: stringoptional id of the ESV variable on the sending tenant that holds the host name of the receiving tenant (no scheme and no path, e.g. 'openam-my-tenant.forgeblocks.com'), e.g. 'esv-remote-proxy-my-tenant-host'. Without it the URLs carry the host of receiverHost. The variable is not created here.
Optionalrealm?: stringrealm of the client on the receiving tenant (default: 'alpha')
host URL of the receiving tenant, e.g. 'https://openam-my-tenant.forgeblocks.com/am' (https only)
id of the ESV secret on the sending tenant that holds the client secret, e.g. 'esv-remote-proxy-my-tenant'
the remote proxy configuration
Create remote proxy. Fails if it already exists.
id/name of the remote proxy without the type prefix
remote proxy object
a promise that resolves to a remote proxy object
Create an empty remote proxy export template
an empty remote proxy export template
Delete all remote proxies
a promise that resolves to an array of the deleted remote proxy objects
Delete remote proxy
id/name of the remote proxy without the type prefix
a promise that resolves to the deleted remote proxy object
Export all remote proxies. The response can be saved to file as is.
a promise that resolves to a RemoteProxyExportInterface object
Export remote proxy. The response can be saved to file as is.
id/name of the remote proxy without the type prefix
a promise that resolves to a RemoteProxyExportInterface object
Generate a random secret for the OAuth2 client of a remote proxy: URL-safe characters from a cryptographically secure random source.
Optionallength: number
number of characters, 32 to 256 (default: 48)
the secret
Get the URL properties (instanceUrl, tokenEndpoint) of a remote proxy
whose host is written out. Such a URL names one receiving tenant, so a
promotion carries that address to the next environment unchanged. A URL
whose host is an ESV placeholder (&{esv.name}, https://&{esv.name}/openidm/)
is resolved by each environment from its own ESV and is portable.
remote proxy object
names of the URL properties that have a fixed host
Get the IDM base URL that routes IDM REST calls through a remote proxy to
the receiving tenant: <host>/openidm/external/idm/<proxyId>. Every IDM
REST call (managed objects, config, ...) addressed below it is made on the
receiving tenant by the mapped user of the proxy.
id/name of the remote proxy without the type prefix
the IDM base URL of the remote proxy
Get the properties of a remote proxy that hold a secret encrypted by the
tenant it was read from. IDM encrypts a plain text password or
clientSecret on write and returns it as an encrypted $crypto object. That
value belongs to one tenant: another tenant accepts it unchecked, and it
fails only when the proxy is used. An ESV placeholder (&{esv.name}) is not
encrypted and is the portable way to configure a secret.
remote proxy object
names of the properties that hold a tenant-bound secret
Import remote proxies. The name and the configuration of every remote proxy are checked before it is written, and a refused remote proxy is never sent to the tenant. Without a result callback every remote proxy is checked before the first one is written: if any of them is refused, nothing is imported.
import data
OptionalresultCallback: ResultCallback<RemoteProxySkeleton>
Optional callback to process individual results. When given, the outcome of every remote proxy is passed to it as it happens (a refused or failed remote proxy as an error that names it) and a refused or failed remote proxy does not stop the others and does not throw: the remote proxies that were imported are returned. The refused remote proxies are reported first, then the outcome of each write. Import data without a remoteProxy object always throws.
a promise that resolves to an array of remote proxy objects
Check the name of a remote proxy. The name becomes part of the IDM entity
id external.idm/<name> and of a REST path, so it is restricted: 1 to 100
characters, starting with a letter or a digit, containing only letters,
digits, ., _ and -. Every operation of this module refuses any other
name before it makes a request.
name of the remote proxy without the type prefix
true if the name is allowed
Read all remote proxies
a promise that resolves to an array of remote proxy objects
Read remote proxy
id/name of the remote proxy (the name of the receiving tenant) without the type prefix
a promise that resolves to a remote proxy object
Check that a remote proxy works: make one read through it
(GET /openidm/info/login on the receiving tenant) and classify the answer.
A working proxy answers with the identity and roles the proxy is mapped to,
which shows at once that the token request, the static user mapping and the
routing work. It makes no change and returns no secret.
name of the remote proxy without the type prefix
a promise that resolves to the result of the check
Update or create remote proxy
id/name of the remote proxy without the type prefix
remote proxy object
a promise that resolves to a remote proxy object
Remote proxy type key used to build the IDM id: 'external.idm/'