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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder ofAmService.static final classA pre-builder class used to discover AM details such as its version and expected cookie name. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the default Open ID Connect JWK Set URI exposed by AM.static AmService.Discoverydiscovery(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 aHandlerthat 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 theSessionServicefor this server.Returns theAsyncRefreshableSupplierbeing used as aSsoTokenprovider for this server.Return the version of the configured OpenAM Server.json()Build the endpoint URI for an endpoint located in the/jsonnamespace.Build the endpoint URI for an endpoint located in the/jsonnamespace.jsonUri()Build the endpoint URI for an endpoint located in the/jsonnamespace.Build the endpoint URI for an endpoint located in the/jsonnamespace.Build the endpoint URI for an endpoint located in the/oauth2namespace.Build the endpoint URI for an endpoint located in the/oauth2namespace.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-stsnamespace.Returns the transformation endpoint located in the/rest-stsnamespace.Returns the URI of the transformation endpoint located in the/rest-stsnamespace.Build the endpoint URI for an endpoint located in the/umanamespace.Build the endpoint URI for an endpoint located in the/umanamespace.uriService(Realm realm) Provides anUriServiceinstance that creates URI for the given realm.withHeadlessAuthentication(Handler delegate) Returns aHandlerwhich 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 aHandlerthat will perform automatic authentication with the provided agent credentials.- Returns:
- the
Handlerthat will perform automatic authentication.
-
withHeadlessAuthentication
Returns aHandlerwhich wraps theHeadlessAuthenticationFilter.- Parameters:
delegate- The delegate Handler.- Returns:
- a
Handlerwhich wraps theHeadlessAuthenticationFilter.
-
getSessionService
Returns theSessionServicefor this server.- Returns:
- the
SessionServicein use for this server.
-
getTokenProvider
Returns theAsyncRefreshableSupplierbeing used as aSsoTokenprovider for this server.- Returns:
- the
AsyncRefreshableSupplierbeing used as aSsoTokenprovider for this server.
-
json
Build the endpoint URI for an endpoint located in the/jsonnamespace.- Returns:
- an absolute endpoint URI.
-
json
Build the endpoint URI for an endpoint located in the/jsonnamespace.- 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/jsonnamespace.- Returns:
- an absolute endpoint URI.
-
jsonUri
Build the endpoint URI for an endpoint located in the/jsonnamespace.- 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/oauth2namespace.- 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/oauth2namespace.- 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/umanamespace.- 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-stsnamespace.- Returns:
- the transformation endpoint located in the
/rest-stsnamespace.
-
sts
Returns the transformation endpoint located in the/rest-stsnamespace.- 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-stsnamespace.
-
stsUri
Returns the URI of the transformation endpoint located in the/rest-stsnamespace.- 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/umanamespace.- 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 anUriServiceinstance 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- theTracingProviderto use when working with AM.- Returns:
- an AM Discovery object ready to build.
-