Class GlobalSecurityManagerRest
- java.lang.Object
-
- de.aristaflow.ilm.ws.rest.base.service.AbstractSubResource<GlobalSecurityManagerWebService>
-
- de.aristaflow.ilm.ws.rest.base.security.GlobalSecurityManagerRest
-
@Produces("application/json") @Consumes("application/json") public class GlobalSecurityManagerRest extends AbstractSubResource<GlobalSecurityManagerWebService>
- See Also:
GlobalSecurityManagerWebService
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
SET_COOKIE_EXAMPLE
The example string for a setting a session token cookie.protected static String
UNSET_COOKIE_EXAMPLE
The example string for a unsetting a session token cookie.
-
Constructor Summary
Constructors Constructor Description GlobalSecurityManagerRest(GlobalSecurityManagerWebService service, de.aristaflow.adept2.base.communication.rest.RequestHandler reqHandler, de.aristaflow.adept2.base.communication.rest.ResponseHandler respHandler, de.aristaflow.adept2.base.communication.rest.ExceptionHandler excpHandler, de.aristaflow.adept2.base.communication.rest.ServiceResourceConfig srConf, Supplier<com.fasterxml.jackson.databind.ObjectMapper> objectMapper, UnaryOperator<Exception> headerDataExcpAdapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<ClientSessionDetails>
_authenticateAllMethod(String method, URI callerUri, AuthenticationData authData)
Authenticates with the designated ILM authentication data.protected ClientSessionDetails
_authenticateMethodCookie(String method, URI callerUri, AuthenticationData authData)
Authenticates with the designated ILM authentication data.protected AuthDataOrgPosSpec.QualifiedAgentList
_preAuthenticateMethod(String method, AuthenticationData authData)
Pre-authenticates with the designated ILM authentication data and wraps the result (qualified agents) in aQualifiedAgentList
.@NotNull List<@Valid ClientSessionDetails>
authenticateAll(@NotBlank String userName, Long orgPosId, @NotNull URI callerUri, String password)
This method authenticates with either the designated password or the OAuth2 authentication token retrieved from the request header using the designated org position or all org positions occupied by the agent if not provided.@NotNull List<@Valid ClientSessionDetails>
authenticateAllMethod(@NotBlank String method, @NotNull URI callerUri, @NotNull AuthenticationData authData)
This method authenticates using the designated org position or all org positions occupied by the agent if not provided.@NotNull @Valid ClientSessionDetails
authenticateCookie(@NotBlank String userName, Long orgPosId, @NotNull URI callerUri, String password)
This method authenticates with either the designated password or the OAuth2 authentication token retrieved from the request header using either the one and only org position the agent has or the designated org position.@NotNull @Valid ClientSessionDetails
authenticateMethodCookie(@NotBlank String method, @NotNull URI callerUri, @NotNull AuthenticationData authData)
Note that the token in the returnedClientSessionDetails
is Base64-URL-encoded (according to RFC 4648, table 2).void
logoff()
protected boolean
orgPosSpecified(AuthDataOrgPosSpec ops)
Gets whether the designatedAuthDataOrgPosSpec
specifies at least one org position.@NotEmpty List<@Valid QualifiedAgent>
preAuthenticate(@NotBlank String userName, String password)
This method pre-authenticates with either the designated password or the OAuth2 authentication token retrieved from the request header.@NotEmpty List<@Valid QualifiedAgent>
preAuthenticateMethod(@NotBlank String method, @NotNull AuthenticationData authData)
-
Methods inherited from class de.aristaflow.ilm.ws.rest.base.service.AbstractSubResource
adaptHeaderData, ensureReqMaxVersion, ensureReqMinVersion, getExceptionHandler, getLogger, getObjectMapper, getRequestHandler, getResponseHandler, getServiceResourceConfig, getWebService
-
-
-
-
Field Detail
-
SET_COOKIE_EXAMPLE
protected static final String SET_COOKIE_EXAMPLE
The example string for a setting a session token cookie.- See Also:
- Constant Field Values
-
UNSET_COOKIE_EXAMPLE
protected static final String UNSET_COOKIE_EXAMPLE
The example string for a unsetting a session token cookie.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GlobalSecurityManagerRest
public GlobalSecurityManagerRest(GlobalSecurityManagerWebService service, de.aristaflow.adept2.base.communication.rest.RequestHandler reqHandler, de.aristaflow.adept2.base.communication.rest.ResponseHandler respHandler, de.aristaflow.adept2.base.communication.rest.ExceptionHandler excpHandler, de.aristaflow.adept2.base.communication.rest.ServiceResourceConfig srConf, Supplier<com.fasterxml.jackson.databind.ObjectMapper> objectMapper, UnaryOperator<Exception> headerDataExcpAdapter)
-
-
Method Detail
-
preAuthenticate
@PUT @Path("/pre-authentication") @Consumes("application/x-www-form-urlencoded") @NotEmpty public @NotEmpty List<@Valid QualifiedAgent> preAuthenticate(@NotBlank @FormParam("userName") @NotBlank String userName, @FormParam("password") String password)
This method pre-authenticates with either the designated password or the OAuth2 authentication token retrieved from the request header.
-
preAuthenticateMethod
@PUT @Path("/pre-generic-authentication") @NotEmpty public @NotEmpty List<@Valid QualifiedAgent> preAuthenticateMethod(@NotBlank @QueryParam("method") @NotBlank String method, @NotNull @NotNull AuthenticationData authData)
-
_preAuthenticateMethod
protected AuthDataOrgPosSpec.QualifiedAgentList _preAuthenticateMethod(String method, AuthenticationData authData)
Pre-authenticates with the designated ILM authentication data and wraps the result (qualified agents) in aQualifiedAgentList
.
-
authenticateCookie
@PUT @Path("/authentication-cookie") @Consumes("application/x-www-form-urlencoded") @NotNull @Valid public @NotNull @Valid ClientSessionDetails authenticateCookie(@NotBlank @FormParam("userName") @NotBlank String userName, @FormParam("orgPosId") Long orgPosId, @NotNull @FormParam("callerUri") @NotNull URI callerUri, @FormParam("password") String password)
This method authenticates with either the designated password or the OAuth2 authentication token retrieved from the request header using either the one and only org position the agent has or the designated org position. If no org position is provided and the agent occupies several org positions, anAuthenticationException
will be thrown.Note that the token in the returned
ClientSessionDetails
is Base64-URL-encoded (according to RFC 4648, table 2).
-
authenticateMethodCookie
@PUT @Path("/generic-authentication-cookie") @NotNull @Valid public @NotNull @Valid ClientSessionDetails authenticateMethodCookie(@NotBlank @QueryParam("method") @NotBlank String method, @NotNull @QueryParam("callerUri") @NotNull URI callerUri, @NotNull @NotNull AuthenticationData authData)
Note that the token in the returnedClientSessionDetails
is Base64-URL-encoded (according to RFC 4648, table 2).
-
_authenticateMethodCookie
protected ClientSessionDetails _authenticateMethodCookie(String method, URI callerUri, AuthenticationData authData)
Authenticates with the designated ILM authentication data.
-
authenticateAll
@PUT @Path("/authentication") @Consumes("application/x-www-form-urlencoded") @NotNull public @NotNull List<@Valid ClientSessionDetails> authenticateAll(@NotBlank @FormParam("userName") @NotBlank String userName, @FormParam("orgPosId") Long orgPosId, @NotNull @FormParam("callerUri") @NotNull URI callerUri, @FormParam("password") String password)
This method authenticates with either the designated password or the OAuth2 authentication token retrieved from the request header using the designated org position or all org positions occupied by the agent if not provided.Note that the token in the returned
ClientSessionDetails
is Base64-URL-encoded (according to RFC 4648, table 2).
-
orgPosSpecified
protected boolean orgPosSpecified(AuthDataOrgPosSpec ops)
Gets whether the designatedAuthDataOrgPosSpec
specifies at least one org position. If not, we usually need to retrieve the one(s) for the provided authentication data.- Parameters:
ops
- The authentication data possibly referring to one or several org positions. This may benull
.- Returns:
- Whether the designated authentication data specifies at least one org position.
-
authenticateAllMethod
@PUT @Path("/generic-authentication") @NotNull public @NotNull List<@Valid ClientSessionDetails> authenticateAllMethod(@NotBlank @QueryParam("method") @NotBlank String method, @NotNull @QueryParam("callerUri") @NotNull URI callerUri, @NotNull @NotNull AuthenticationData authData)
This method authenticates using the designated org position or all org positions occupied by the agent if not provided.Note that the token in the returned
ClientSessionDetails
is Base64-URL-encoded (according to RFC 4648, table 2).
-
_authenticateAllMethod
protected List<ClientSessionDetails> _authenticateAllMethod(String method, URI callerUri, AuthenticationData authData)
Authenticates with the designated ILM authentication data.
-
logoff
@GET @Path("/logoff") public void logoff()
-
-