Package org.platformlayer.model

Examples of org.platformlayer.model.AuthenticationCredentials


  //
  // authenticatedScope.put(OpsAuthentication.class, opsAuthentication);
  // }

  protected AuthenticationCredentials findCredentials(HttpServletRequest httpRequest) throws Exception {
    AuthenticationCredentials creds = null;

    final String authToken = httpRequest.getHeader("X-Auth-Token");
    if (authToken != null) {
      creds = new AuthenticationCredentials() {
        @Override
        public AuthenticationToken getToken() {
          return new PlatformlayerAuthenticationToken(authToken);
        }
      };
View Full Code Here


    if (servletRequest instanceof HttpServletRequest) {
      HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
      HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;

      try {
        AuthenticationCredentials credentials = findCredentials(httpServletRequest);

        // if (authenticated == null) {
        // httpServletResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        // return;
        // } else {
View Full Code Here

  AuthenticationTokenValidator authenticationTokenValidator;

  protected AuthenticationCredentials findCredentials(HttpServletRequest httpRequest) throws Exception {
    final String authToken = httpRequest.getHeader("X-Auth-Token");
    if (authToken != null) {
      AuthenticationCredentials creds = new PlatformLayerAuthenticationCredentials(authToken);
      return creds;
    }

    X509Certificate[] certChain = (X509Certificate[]) httpRequest
        .getAttribute("javax.servlet.request.X509Certificate");
    if (certChain != null && certChain.length != 0) {
      AuthenticationCredentials creds = new CertificateAuthenticationCredentials(certChain);
      return creds;
    }

    return null;
  }
View Full Code Here

    if (servletRequest instanceof HttpServletRequest) {
      HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
      HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;

      try {
        AuthenticationCredentials credentials = findCredentials(httpServletRequest);

        authenticatedScope.put(AuthenticationCredentials.class, credentials);
      } catch (SecurityException e) {
        httpServletResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        return;
View Full Code Here

  // return opsAuth;
  // }

  @Override
  protected AuthenticationCredentials getAuthenticationCredentials() {
    AuthenticationCredentials auth = getScopeParameter(AuthenticationCredentials.class, false);
    if (auth == null) {
      throw new WebApplicationException(HttpServletResponse.SC_FORBIDDEN);
    }
    return auth;
  }
View Full Code Here

TOP

Related Classes of org.platformlayer.model.AuthenticationCredentials

Copyright © 2018 www.massapicom. 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.