public final class AmService extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AmService.Builder
Builder of
AmService . |
Modifier and Type | Field and Description |
---|---|
static AmVersion |
DEFAULT_AM_VERSION
AM 5.0.0 (equivalent of OpenAM 14.0.0).
|
static String |
DEFAULT_COOKIE_NAME
The default cookie header name for the OpenAM Server.
|
Modifier and Type | Method and Description |
---|---|
static AmService.Builder |
builder(AmService amService)
Returns a new
AmService.Builder for creating a new AmService instance from a given one. |
static AmService.Builder |
builder(URI baseUri,
Handler amHandler,
Clock clock,
String agentId,
SecretReference<GenericSecret> agentPassword)
Returns a new
AmService.Builder for creating a new AmService instance. |
String |
getAgentId()
Returns the agent's ID.
|
Handler |
getAuthenticatedHandler()
Returns a
Handler that will perform automatic authentication
with the provided agent credentials. |
AuthenticationService |
getAuthenticationService()
Returns the service used to authenticate subjects to AM.
|
URI |
getBaseUri()
Return the base URI for this server.
|
String |
getCookieName()
Returns the cookie header name used by AM server.
|
Handler |
getHandler()
Returns the handler to use with this configuration.
|
Optional<NotificationService> |
getNotificationService()
Returns the AM notification service.
|
Realm |
getRealm()
Returns the realm to use with this configuration.
|
SessionService |
getSessionService()
Returns the
SessionService for this server. |
AsyncRefreshableSupplier<SsoToken,AuthenticationException> |
getTokenProvider()
Returns the
AsyncRefreshableSupplier being used as a SsoToken provider for this server. |
Version |
getVersion()
Return the version of the configured OpenAM Server.
|
String |
json()
Build the endpoint URI for an endpoint located in the
/json namespace. |
String |
json(String endpoint)
Build the endpoint URI for an endpoint located in the
/json namespace. |
URI |
jsonUri()
Build the endpoint URI for an endpoint located in the
/json namespace. |
URI |
jsonUri(String endpoint)
Build the endpoint URI for an endpoint located in the
/json namespace. |
String |
oauth2(String endpoint)
Build the endpoint URI for an endpoint located in the
/oauth2 namespace. |
URI |
oauth2Uri(String endpoint)
Build the endpoint URI for an endpoint located in the
/oauth2 namespace. |
void |
start()
Starts this server instance (and associated services).
|
void |
stop()
Stops this server instance (and associated services).
|
String |
sts()
Returns the transformation endpoint located in the
/rest-sts namespace. |
String |
sts(String endpoint)
Returns the transformation endpoint located in the
/rest-sts namespace. |
URI |
stsUri(String endpoint)
Returns the URI of the transformation endpoint located in the
/rest-sts namespace. |
String |
uma(String endpoint)
Build the endpoint URI for an endpoint located in the
/uma namespace. |
URI |
umaUri(String endpoint)
Build the endpoint URI for an endpoint located in the
/uma namespace. |
UriService |
uriService(Realm realm)
Provides an
UriService instance that creates URI for the given realm. |
Handler |
withHeadlessAuthentication(Handler delegate)
Returns a
Handler which wraps the HeadlessAuthenticationFilter . |
public static final String DEFAULT_COOKIE_NAME
public static final AmVersion DEFAULT_AM_VERSION
public static AmService.Builder builder(URI baseUri, Handler amHandler, Clock clock, String agentId, SecretReference<GenericSecret> agentPassword)
AmService.Builder
for creating a new AmService
instance.baseUri
- AM base URI (ex: http://openam.example.com/openam), never null
.amHandler
- The handler to use the CrestSessionService
, not null
.clock
- The clock to use when dealing with time, not null
.agentId
- The agent id, not null
.agentPassword
- The agent's password, not null
.public static AmService.Builder builder(AmService amService)
AmService.Builder
for creating a new AmService
instance from a given one.amService
- The AmService
to copy.AmService
.public Handler getHandler()
public AuthenticationService getAuthenticationService()
public Optional<NotificationService> getNotificationService()
public String getAgentId()
public void start() throws Exception
Exception
- if startup failedpublic void stop()
public Realm getRealm()
public String getCookieName()
public URI getBaseUri()
public Version getVersion()
public Handler getAuthenticatedHandler()
Handler
that will perform automatic authentication
with the provided agent credentials.Handler
that will perform automatic authentication.public Handler withHeadlessAuthentication(Handler delegate)
Handler
which wraps the HeadlessAuthenticationFilter
.delegate
- The delegate Handler.Handler
which wraps the HeadlessAuthenticationFilter
.public SessionService getSessionService()
SessionService
for this server.SessionService
in use for this server.public AsyncRefreshableSupplier<SsoToken,AuthenticationException> getTokenProvider()
AsyncRefreshableSupplier
being used as a SsoToken
provider for this server.AsyncRefreshableSupplier
being used as a SsoToken
provider for this server.public String json()
/json
namespace.public String json(String endpoint)
/json
namespace.endpoint
- endpoint name, such as policies or /serverinfo/version. The endpoint MUST be a
proper encoded path.public URI jsonUri()
/json
namespace.public URI jsonUri(String endpoint)
/json
namespace.endpoint
- endpoint name, such as policies or /serverinfo/version. The endpoint MUST be a
proper encoded path.public String oauth2(String endpoint)
/oauth2
namespace.endpoint
- endpoint name, such as .well-known/openid-configuration or /authorize. The endpoint
MUST be a proper encoded path.public URI oauth2Uri(String endpoint)
/oauth2
namespace.endpoint
- endpoint name, such as .well-known/openid-configuration or /authorize. The endpoint
MUST be a proper encoded path.public String uma(String endpoint)
/uma
namespace.endpoint
- endpoint name, such as .well-known/uma-configuration or /authz_request. The
endpoint MUST be a proper encoded path.public String sts()
/rest-sts
namespace./rest-sts
namespace.public String sts(String endpoint)
/rest-sts
namespace.endpoint
- The endpoint name, such as rest-sts/username-transformer. The endpoint MUST be a proper
encoded path./rest-sts
namespace.public URI stsUri(String endpoint)
/rest-sts
namespace.endpoint
- The endpoint name, such as rest-sts/username-transformer. The endpoint MUST be a proper
encoded path.public URI umaUri(String endpoint)
/uma
namespace.endpoint
- endpoint name, such as .well-known/uma-configuration or /authz_request. The
endpoint MUST be a proper encoded path.public UriService uriService(Realm realm)
UriService
instance that creates URI for the given realm.realm
- the realm we want URIs for (never null
)Copyright 2011-2017 ForgeRock AS.