All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.resteasy.plugins.server.servlet.ServletSecurityContext Maven / Gradle / Ivy

The newest version!
package org.jboss.resteasy.plugins.server.servlet;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.SecurityContext;
import java.security.Principal;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class ServletSecurityContext implements SecurityContext
{
   private HttpServletRequest request;

   public ServletSecurityContext(HttpServletRequest request)
   {
      this.request = request;
   }

   public Principal getUserPrincipal()
   {
      return request.getUserPrincipal();
   }

   public boolean isUserInRole(String role)
   {
      return request.isUserInRole(role);
   }

   public boolean isSecure()
   {
      return request.isSecure();
   }

   public String getAuthenticationScheme()
   {
      return request.getAuthType();
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy