Class GlobalSecurityManagerRest

    • 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.
      • 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, an AuthenticationException will be thrown.

        Note that the token in the returned ClientSessionDetails is Base64-URL-encoded (according to RFC 4648, table 2).

      • 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 designated AuthDataOrgPosSpec 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 be null.
        Returns:
        Whether the designated authentication data specifies at least one org position.