public Response afterReceiveRequest()

in edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationFilter.java [34:48]


  public Response afterReceiveRequest(Invocation invocation, HttpServletRequestEx requestEx) {
    String authentication = requestEx.getHeader(CommonConstants.HTTP_HEADER_AUTHORIZATION);
    String type = requestEx.getHeader(CommonConstants.HTTP_HEADER_AUTHORIZATION_TYPE);
    if (authentication != null) {
      String[] tokens = authentication.split(" ");
      if (tokens.length == 2) {
        if (tokens[0].equals(CommonConstants.TOKEN_TYPE_BEARER)) {
          invocation.addContext(CommonConstants.CONTEXT_HEADER_AUTHORIZATION, tokens[1]);
          invocation.addContext(CommonConstants.CONTEXT_HEADER_AUTHORIZATION_TYPE,
              type == null ? CommonConstants.AUTHORIZATION_TYPE_ACCESS_TOKEN : type);
        }
      }
    }
    return null;
  }