net.officefloor.tutorial.jwtresourcehttpserver.JwtRoles Maven / Gradle / Ivy
package net.officefloor.tutorial.jwtresourcehttpserver;
import java.util.Arrays;
import net.officefloor.plugin.section.clazz.Parameter;
import net.officefloor.web.jwt.role.JwtRoleCollector;
/**
* Provides translation of {@link Claims} to roles.
*
* @author Daniel Sagenschneider
*/
// START SNIPPET: tutorial
public class JwtRoles {
public void retrieveRoles(@Parameter JwtRoleCollector collector) {
collector.setRoles(Arrays.asList(collector.getClaims().getRoles()));
}
}
// END SNIPPET: tutorial © 2015 - 2025 Weber Informatics LLC | Privacy Policy