Skip to content

Commit

Permalink
A3: Fixed docs wrt bakksjo's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Holy committed Oct 18, 2012
1 parent 1f19ad7 commit 9ed85b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
3 changes: 1 addition & 2 deletions a3/README.md
Expand Up @@ -11,8 +11,7 @@ name, password, role(s), custom properties and more.
Standalone use
--------------

org.cloudname.a3.A3Client a3Client = ...;
if (a3Client.authenticate("user", "psw").isOk) ...;
See `/a3/src/test/java/org/cloudname/a3/A3ClientTest.java` for examples.

Use with Jersey
---------------
Expand Down
15 changes: 7 additions & 8 deletions a3/src/main/java/org/cloudname/a3/jaxrs/JerseyRequestFilter.java
@@ -1,24 +1,23 @@
package org.cloudname.a3.jaxrs;

import com.sun.jersey.api.container.MappableContainerException;
import com.sun.jersey.core.util.Base64;
import com.sun.jersey.spi.container.ContainerRequest;
import com.sun.jersey.spi.container.ContainerRequestFilter;

import java.security.Principal;

import javax.ws.rs.core.Context;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.Provider;

import org.cloudname.a3.A3Client;
import org.cloudname.a3.A3Principal;
import org.cloudname.a3.AuthnResult;
import org.cloudname.a3.domain.User;

import com.sun.jersey.api.container.MappableContainerException;
import com.sun.jersey.core.util.Base64;
import com.sun.jersey.spi.container.ContainerRequest;
import com.sun.jersey.spi.container.ContainerRequestFilter;

/**
* Check the authentication header and set user principal on the request's security contexts
* Checks the authentication header and sets user principal on the request's security contexts
* according to it. It can be then accessed in REST resources via
* <code>@Context SecurityContext sc</code> or used to limit access to them based on
* the user's roles and <code>@RolesAllowed</code> in cooperation with
Expand All @@ -30,7 +29,7 @@
*
* <h4>Dependencies</h4>
* The filter expects an {@link A3Client} instance to be provided by Jersey. For that to work
* you need to have a {@link Provider} creating it available somewhere where Jersey can
* you need to have a @{@link javax.ws.rs.ext.Provider.Provider} creating it available somewhere where Jersey can
* find it.
*
* <h4>Configuration</h4>
Expand Down

0 comments on commit 9ed85b5

Please sign in to comment.