Examples of IApiTokenizerManager


Examples of org.entando.entando.plugins.jptokenapi.aps.system.token.IApiTokenizerManager

    try {
      UserDetails currentUser = (UserDetails) session.getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
      if (null == currentUser || currentUser.getUsername().equals(SystemConstants.GUEST_USER_NAME)) {
        return super.doEndTag();
      }
      IApiTokenizerManager apiTokenizerManager =
        (IApiTokenizerManager) ApsWebApplicationUtils.getBean(JpTokenApiSystemConstants.TOKENIZER_MANAGER, this.pageContext);
      this._value = apiTokenizerManager.getToken(currentUser.getUsername());
      this.evalValue();
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "doEndTag");
      throw new JspException("Error closing tag ", t);
    }
View Full Code Here

Examples of org.entando.entando.plugins.jptokenapi.aps.system.token.IApiTokenizerManager

  }
 
  protected void extractTokenParameters(String entandoApiToken, ApiMethod apiMethod,
      HttpServletRequest request, Properties properties) throws ApiException, IOException, ServletException {
    UserDetails user = null;
        IApiTokenizerManager tokenizerManager =
                (IApiTokenizerManager) ApsWebApplicationUtils.getBean(JpTokenApiSystemConstants.TOKENIZER_MANAGER, request);
        IAuthenticationProviderManager authenticationProvider =
                (IAuthenticationProviderManager) ApsWebApplicationUtils.getBean(SystemConstants.AUTHENTICATION_PROVIDER_MANAGER, request);
        IAuthorizationManager authorizationManager =
                (IAuthorizationManager) ApsWebApplicationUtils.getBean(SystemConstants.AUTHORIZATION_SERVICE, request);
        try {
            String username = tokenizerManager.getUser(entandoApiToken);
            user = authenticationProvider.getUser(username);
            if (null != user) {
                properties.put(SystemConstants.API_USER_PARAMETER, user);
            } else if (apiMethod.getRequiredAuth()) {
        throw new ApiException(IApiErrorCodes.API_AUTHENTICATION_REQUIRED, "Invalid or missing user for token '" + entandoApiToken + "'", Response.Status.UNAUTHORIZED);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.