Coming Up for Air

GlassFish 3.1.2, REST Security, and the Jersey Client

I recently blogged about a change we made in GlassFish 3.1.2 with regard to REST security. Specifically, we added some CSRF protection (you can read the details here). For those of you using the Jersey Client, updating your code to support this change is very simple:

1
2
3
4
5
import com.sun.jersey.api.client.filter.CsrfProtectionFilter;
// ...
Client client = new Client();
client.addFilter(new CsrfProtectionFilter());
// ...

On the client side, that’s all you have to change. Jersey will take care of the details.

Hat tip to Dan Allen for suggesting this post. :)

tags: GlassFish REST

Quotes

Sample quote

Quote source