Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void testGetUsersUnauthenticated() {
final Response usersResponse = usersTarget.request(MediaType.APPLICATION_JSON_TYPE)
.buildGet()
.invoke();
assertEquals(Status.UNAUTHORIZED.getStatusCode(), usersResponse.getStatus());
assertEquals(Status.FORBIDDEN.getStatusCode(), usersResponse.getStatus());
}

@SuppressWarnings({"checkstyle:MagicNumber"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/
package org.apache.shiro.web.jaxrs;

import org.apache.shiro.authz.UnauthenticatedException;

import javax.ws.rs.core.Application;
import javax.ws.rs.core.Feature;
import javax.ws.rs.core.FeatureContext;
Expand All @@ -30,14 +28,14 @@
* Shiro JAX-RS feature which includes {@link UnauthorizedExceptionExceptionMapper}, {@link SubjectPrincipalRequestFilter}, and
* {@link ShiroAnnotationFilterFeature}.
* <p>
* Typically a JAX-RS {@link Application} class will include this Feature class in the
* Typically, a JAX-RS {@link Application} class will include this Feature class in the
* classes returned from {@link Application#getClasses()} method, for example:
* <blockquote><pre>
* public class SampleApplication extends Application {
*
* @Override
* public Set<Class<?>> getClasses() {
* Set<Class<?>> classes = new HashSet<Class<?>>();
* {@code @Override}
* {@code public Set<Class<?>>} getClasses() {
* {@code Set<Class<?>> classes = new HashSet<Class<?>>();}
*
* // register Shiro
* classes.add(ShiroFeature.class);
Expand All @@ -55,9 +53,8 @@ public class ShiroFeature implements Feature {

@Override
public boolean configure(FeatureContext context) {

context.register(UnauthenticatedExceptionExceptionMapper.class);
context.register(UnauthorizedExceptionExceptionMapper.class);
context.register(UnauthenticatedException.class);
context.register(SubjectPrincipalRequestFilter.class);
context.register(ShiroAnnotationFilterFeature.class);

Expand Down