Change OAuthAutheticator to get api version and context

4.x.x
manoj 10 years ago
parent f2c33f9421
commit 54290e0ab3

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

Loading…
Cancel
Save