|
|
@ -55,28 +55,16 @@ public class OAuthAuthenticator implements WebappAuthenticator {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
StringTokenizer tokenizer = new StringTokenizer(requestUri, "/");
|
|
|
|
StringTokenizer tokenizer = new StringTokenizer(requestUri, "/");
|
|
|
|
String context = request.getContextPath();
|
|
|
|
String context = tokenizer.nextToken();
|
|
|
|
if (context == null || "".equals(context)) {
|
|
|
|
if (context == null || "".equals(context)) {
|
|
|
|
context = tokenizer.nextToken();
|
|
|
|
return Status.CONTINUE;
|
|
|
|
if (context == null || "".equals(context)) {
|
|
|
|
|
|
|
|
return Status.CONTINUE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String apiVersion = tokenizer.nextToken();
|
|
|
|
// boolean isContextCached = false;
|
|
|
|
String domain = request.getHeader(APITokenValidator.getAPIManagerClientDomainHeader());
|
|
|
|
// if (APIUtil.getAPIContextCache().get(context) != null) {
|
|
|
|
String authLevel = authenticator.getResourceAuthenticationScheme(context, apiVersion,
|
|
|
|
// isContextCached = Boolean.parseBoolean(APIUtil.getAPIContextCache().get(context).toString());
|
|
|
|
request.getRequestURI(), request.getMethod());
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (!isContextCached) {
|
|
|
|
|
|
|
|
// return Status.CONTINUE;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String apiVersion = tokenizer.nextToken();
|
|
|
|
|
|
|
|
String domain = request.getHeader(APITokenValidator.getAPIManagerClientDomainHeader());
|
|
|
|
|
|
|
|
String authLevel = authenticator.getResourceAuthenticationScheme(context, apiVersion,
|
|
|
|
|
|
|
|
request.getRequestURI(), request.getMethod());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Constants.NO_MATCHING_AUTH_SCHEME.equals(authLevel)) {
|
|
|
|
if (Constants.NO_MATCHING_AUTH_SCHEME.equals(authLevel)) {
|
|
|
|
AuthenticationFrameworkUtil.handleNoMatchAuthScheme(request, response, request.getMethod(),
|
|
|
|
AuthenticationFrameworkUtil.handleNoMatchAuthScheme(request, response, request.getMethod(),
|
|
|
|
apiVersion, context);
|
|
|
|
apiVersion, context);
|
|
|
|