Package org.forgerock.openig.tools.am
Class AmService
java.lang.Object
org.forgerock.openig.tools.am.AmService
Creates a configuration class for AM.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder ofAmService
.static final class
A pre-builder class used to discover AM details such as its version and expected cookie name. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the default Open ID Connect JWK Set URI exposed by AM.static AmService.Discovery
discovery
(URI baseUri, Realm realm, String cookieName, Version versionHint, String agentId, SecretReference<GenericSecret> agentPassword, Handler amHandler, org.forgerock.openig.tracing.TracingProvider tracingProvider) Create an AM Discovery object which will get information from AM upon building.Returns the agent's ID.Returns aHandler
that will perform automatic authentication with the provided agent credentials.Return the base URI for this server.Returns the cookie header name used by AM server.Returns the handler to use with this configuration.Returns the AM notification service.getRealm()
Returns the realm to use with this configuration.Returns theSessionService
for this server.Returns theAsyncRefreshableSupplier
being used as aSsoToken
provider for this server.Return the version of the configured OpenAM Server.json()
Build the endpoint URI for an endpoint located in the/json
namespace.Build the endpoint URI for an endpoint located in the/json
namespace.jsonUri()
Build the endpoint URI for an endpoint located in the/json
namespace.Build the endpoint URI for an endpoint located in the/json
namespace.Build the endpoint URI for an endpoint located in the/oauth2
namespace.Build the endpoint URI for an endpoint located in the/oauth2
namespace.start()
Starts this server instance (and associated services).stop()
Stops this server instance (and associated services).sts()
Returns the transformation endpoint located in the/rest-sts
namespace.Returns the transformation endpoint located in the/rest-sts
namespace.Returns the URI of the transformation endpoint located in the/rest-sts
namespace.Build the endpoint URI for an endpoint located in the/uma
namespace.Build the endpoint URI for an endpoint located in the/uma
namespace.uriService
(Realm realm) Provides anUriService
instance that creates URI for the given realm.withHeadlessAuthentication
(Handler delegate) Returns aHandler
which wraps theHeadlessAuthenticationFilter
.
-
Field Details
-
DEFAULT_AM_VERSION
AM 6.0.0.
-
-
Method Details
-
getHandler
Returns the handler to use with this configuration.- Returns:
- The handler used in this configuration.
-
getNotificationService
Returns the AM notification service.- Returns:
- the AM notification service.
-
getAgentId
Returns the agent's ID.- Returns:
- the agent's ID.
-
start
Starts this server instance (and associated services).- Returns:
- A promise of a started AM service or an Exception if startup failed
-
stop
Stops this server instance (and associated services).- Returns:
- Promise completing the service being stopped
-
getRealm
Returns the realm to use with this configuration.- Returns:
- The realm used in this configuration.
-
getCookieName
Returns the cookie header name used by AM server.- Returns:
- the cookie header name used by AM server.
-
getBaseUri
Return the base URI for this server.- Returns:
- the base URI for this server.
-
getVersion
Return the version of the configured OpenAM Server.- Returns:
- the version of the configured OpenAM Server.
-
getAuthenticatedHandler
Returns aHandler
that will perform automatic authentication with the provided agent credentials.- Returns:
- the
Handler
that will perform automatic authentication.
-
withHeadlessAuthentication
Returns aHandler
which wraps theHeadlessAuthenticationFilter
.- Parameters:
delegate
- The delegate Handler.- Returns:
- a
Handler
which wraps theHeadlessAuthenticationFilter
.
-
getSessionService
Returns theSessionService
for this server.- Returns:
- the
SessionService
in use for this server.
-
getTokenProvider
Returns theAsyncRefreshableSupplier
being used as aSsoToken
provider for this server.- Returns:
- the
AsyncRefreshableSupplier
being used as aSsoToken
provider for this server.
-
json
Build the endpoint URI for an endpoint located in the/json
namespace.- Returns:
- an absolute endpoint URI.
-
json
Build the endpoint URI for an endpoint located in the/json
namespace.- Parameters:
endpoint
- endpoint name, such as policies or /serverinfo/version. The endpoint MUST be a proper encoded path.- Returns:
- an absolute endpoint URI.
-
jsonUri
Build the endpoint URI for an endpoint located in the/json
namespace.- Returns:
- an absolute endpoint URI.
-
jsonUri
Build the endpoint URI for an endpoint located in the/json
namespace.- Parameters:
endpoint
- endpoint name, such as policies or /serverinfo/version. The endpoint MUST be a proper encoded path.- Returns:
- an absolute endpoint URI
-
oauth2
Build the endpoint URI for an endpoint located in the/oauth2
namespace.- Parameters:
endpoint
- endpoint name, such as .well-known/openid-configuration or /authorize. The endpoint MUST be a proper encoded path.- Returns:
- an absolute endpoint URI
-
oauth2Uri
Build the endpoint URI for an endpoint located in the/oauth2
namespace.- Parameters:
endpoint
- endpoint name, such as .well-known/openid-configuration or /authorize. The endpoint MUST be a proper encoded path.- Returns:
- an absolute endpoint URI.
-
uma
Build the endpoint URI for an endpoint located in the/uma
namespace.- Parameters:
endpoint
- endpoint name, such as .well-known/uma-configuration or /authz_request. The endpoint MUST be a proper encoded path.- Returns:
- an absolute endpoint URI.
-
sts
Returns the transformation endpoint located in the/rest-sts
namespace.- Returns:
- the transformation endpoint located in the
/rest-sts
namespace.
-
sts
Returns the transformation endpoint located in the/rest-sts
namespace.- Parameters:
endpoint
- The endpoint name, such as rest-sts/username-transformer. The endpoint MUST be a proper encoded path.- Returns:
- the transformation endpoint located in the
/rest-sts
namespace.
-
stsUri
Returns the URI of the transformation endpoint located in the/rest-sts
namespace.- Parameters:
endpoint
- The endpoint name, such as rest-sts/username-transformer. The endpoint MUST be a proper encoded path.- Returns:
- an absolute endpoint URI.
-
umaUri
Build the endpoint URI for an endpoint located in the/uma
namespace.- Parameters:
endpoint
- endpoint name, such as .well-known/uma-configuration or /authz_request. The endpoint MUST be a proper encoded path.- Returns:
- an absolute endpoint URI.
-
uriService
Provides anUriService
instance that creates URI for the given realm.- Parameters:
realm
- the realm we want URIs for (nevernull
)- Returns:
- the associated UriService
-
defaultOidcJwkSetUri
Returns the default Open ID Connect JWK Set URI exposed by AM.This AM URL is stable. Although being an OIDC endpoint it is accessible even if OIDC is not configured.
- Returns:
- the OpenID Connect JWK Set URI
-
discovery
public static AmService.Discovery discovery(URI baseUri, Realm realm, String cookieName, Version versionHint, String agentId, SecretReference<GenericSecret> agentPassword, Handler amHandler, org.forgerock.openig.tracing.TracingProvider tracingProvider) Create an AM Discovery object which will get information from AM upon building.- Parameters:
baseUri
- the AM base URIrealm
- the realm to use, defaults to root realmcookieName
- the cookie name used for agent authentication (may be null)versionHint
- a hint on the expected version (may be null)agentId
- the agent IDagentPassword
- the agent password as a secret referenceamHandler
- the Handler used for AM callstracingProvider
- theTracingProvider
to use when working with AM.- Returns:
- an AM Discovery object ready to build.
-