@Override public void filter(ContainerRequestContext requestContext) throws IOException { final BasicCredentials credentials = getCredentials(requestContext.getHeaders().getFirst(HttpHeaders.AUTHORIZATION)); if (!authenticate(requestContext, credentials, SecurityContext.BASIC_AUTH)) { throw new WebApplicationException(unauthorizedHandler.buildResponse(prefix, realm)); } }
@Override public void filter(final ContainerRequestContext requestContext) throws IOException { String credentials = getCredentials(requestContext.getHeaders().getFirst(HttpHeaders.AUTHORIZATION)); // If Authorization header is not used, check query parameter where token can be passed as well if (credentials == null) { credentials = requestContext.getUriInfo().getQueryParameters().getFirst(OAUTH_ACCESS_TOKEN_PARAM); } if (!authenticate(requestContext, credentials, SecurityContext.BASIC_AUTH)) { throw new WebApplicationException(unauthorizedHandler.buildResponse(prefix, realm)); } }
@Override public void filter(final ContainerRequestContext requestContext) throws IOException { final String jwt = requestContext.getHeaders().getFirst(HttpHeaders.AUTHORIZATION); boolean _authenticate = this.authenticate(requestContext, jwt, SecurityContext.DIGEST_AUTH); boolean _not = (!_authenticate); if (_not) { Response _buildResponse = this.unauthorizedHandler.buildResponse(this.prefix, this.realm); throw new WebApplicationException(_buildResponse); } } }
@Override public void filter(final ContainerRequestContext requestContext) throws IOException { final MultivaluedMap<String, String> queryParams = requestContext.getUriInfo().getQueryParameters(); final String authorization = queryParams.getFirst(ApiTokenAuthFilter.API_TOKEN_QUERY_PARAM); boolean _authenticate = this.authenticate(requestContext, authorization, SecurityContext.DIGEST_AUTH); boolean _not = (!_authenticate); if (_not) { Response _buildResponse = this.unauthorizedHandler.buildResponse(this.prefix, this.realm); throw new WebApplicationException(_buildResponse); } } }
@Override public void filter(ContainerRequestContext requestContext) throws IOException { final BasicCredentials credentials = getCredentials(requestContext.getHeaders().getFirst(HttpHeaders.AUTHORIZATION)); if (!authenticate(requestContext, credentials, SecurityContext.BASIC_AUTH)) { throw new WebApplicationException(unauthorizedHandler.buildResponse(prefix, realm)); } }
@Override public void filter(final ContainerRequestContext requestContext) throws IOException { String credentials = getCredentials(requestContext.getHeaders().getFirst(HttpHeaders.AUTHORIZATION)); // If Authorization header is not used, check query parameter where token can be passed as well if (credentials == null) { credentials = requestContext.getUriInfo().getQueryParameters().getFirst(OAUTH_ACCESS_TOKEN_PARAM); } if (!authenticate(requestContext, credentials, SecurityContext.BASIC_AUTH)) { throw new WebApplicationException(unauthorizedHandler.buildResponse(prefix, realm)); } }
throw new WebApplicationException(unauthorizedHandler.buildResponse(prefix, realm));
throw new WebApplicationException(unauthorizedHandler.buildResponse(prefix, realm));
throw new WebApplicationException(unauthorizedHandler.buildResponse(prefix, realm));
throw new WebApplicationException(unauthorizedHandler.buildResponse(prefix, realm));
throw new WebApplicationException(unauthorizedHandler.buildResponse(prefix, realm));
throw new WebApplicationException(unauthorizedHandler.buildResponse(prefix, realm));