Examples of IAuthenticationProviderManager


Examples of com.agiletec.aps.system.services.user.IAuthenticationProviderManager

  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.