use of org.wildfly.security.authz.Attributes.Entry in project wildfly by wildfly.
the class AttributePrintingServlet method doGet.
/**
* Writes plain-text response with all of the current identities attributes.
*/
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("text/plain");
final PrintWriter writer = resp.getWriter();
SecurityDomain securityDomain = SecurityDomain.getCurrent();
SecurityIdentity securityIdentity = securityDomain.getCurrentSecurityIdentity();
Attributes attributes = securityIdentity.getAttributes();
for (Entry currentAttribute : attributes.entries()) {
writer.print(currentAttribute.getKey());
writer.print("=");
for (int i = 0; i < currentAttribute.size(); i++) {
writer.print(currentAttribute.get(i));
if (i < currentAttribute.size()) {
writer.print(",");
}
}
writer.println();
}
writer.close();
}
Aggregations