net.officefloor.tutorial.jwthttpserver.SecuredResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JwtHttpServer Show documentation
Show all versions of JwtHttpServer Show documentation
Tutorial of implementing JWT
package net.officefloor.tutorial.jwthttpserver;
import java.io.IOException;
import net.officefloor.server.http.ServerHttpConnection;
import net.officefloor.web.security.HttpAccess;
/**
* Secured resource.
*
* @author Daniel Sagenschneider
*/
public class SecuredResource {
@HttpAccess(ifRole = "tutorial")
public void secure(ServerHttpConnection connection) throws IOException {
connection.getResponse().getEntityWriter().write("Hello JWT secured World");
}
}