Tabnine Logo
Cookie.setHttpOnly
Code IndexAdd Tabnine to your IDE (free)

How to use
setHttpOnly
method
in
org.pac4j.core.context.Cookie

Best Java code snippets using org.pac4j.core.context.Cookie.setHttpOnly (Showing top 11 results out of 315)

origin: jooby-project/jooby

@Override public Collection<Cookie> getRequestCookies() {
 return req.cookies().stream().map(c -> {
  Cookie cookie = new Cookie(c.name(), c.value().orElse(null));
  c.domain().ifPresent(cookie::setDomain);
  c.path().ifPresent(cookie::setPath);
  cookie.setSecure(c.secure());
  cookie.setHttpOnly(c.httpOnly());
  return cookie;
 }).collect(Collectors.toList());
}
origin: jooby-project/jooby

@Override
public Collection<Cookie> getRequestCookies() {
 return req.cookies().stream().map(c -> {
  Cookie cookie = new Cookie(c.name(), c.value().orElse(null));
  c.domain().ifPresent(cookie::setDomain);
  c.path().ifPresent(cookie::setPath);
  cookie.setHttpOnly(c.httpOnly());
  cookie.setSecure(c.secure());
  return cookie;
 }).collect(Collectors.toList());
}
origin: pippo-java/pippo

@Override
public Collection<Cookie> getRequestCookies() {
  return getRequest().getCookies().stream().map(c -> {
    Cookie cookie = new Cookie(c.getName(), c.getValue());
    cookie.setComment(c.getComment());
    cookie.setSecure(c.getSecure());
    cookie.setPath(c.getPath());
    cookie.setHttpOnly(c.isHttpOnly());
    cookie.setDomain(c.getDomain());
    cookie.setMaxAge(c.getMaxAge());
    cookie.setVersion(c.getVersion());
    return cookie;
  }).collect(Collectors.toList());
}
origin: org.jooby/jooby-pac4j

@Override
public Collection<Cookie> getRequestCookies() {
 return req.cookies().stream().map(c -> {
  Cookie cookie = new Cookie(c.name(), c.value().orElse(null));
  c.domain().ifPresent(cookie::setDomain);
  c.path().ifPresent(cookie::setPath);
  cookie.setHttpOnly(c.httpOnly());
  cookie.setSecure(c.secure());
  return cookie;
 }).collect(Collectors.toList());
}
origin: pac4j/undertow-pac4j

@Override
public Collection<Cookie> getRequestCookies() {
  final Collection<io.undertow.server.handlers.Cookie> uCookies = exchange.getRequestCookies().values();
  final List<Cookie> cookies = new ArrayList<>(uCookies.size());
  for (final io.undertow.server.handlers.Cookie uCookie : uCookies) {
    final Cookie cookie = new Cookie(uCookie.getName(), uCookie.getValue());
    cookie.setComment(uCookie.getComment());
    cookie.setDomain(uCookie.getDomain());
    cookie.setPath(uCookie.getPath());
    cookie.setMaxAge(uCookie.getMaxAge() == null ? -1 : uCookie.getMaxAge());
    cookie.setSecure(uCookie.isSecure());
    cookie.setHttpOnly(uCookie.isHttpOnly());
    cookies.add(cookie);
  }
  return cookies;
}
origin: org.apache.knox/gateway-provider-security-pac4j

public void set(WebContext context, String key, Object value) {
  logger.debug("Save in session: {} = {}", key, value);
  final Cookie cookie = new Cookie(PAC4J_SESSION_PREFIX + key, compressEncryptBase64(value));
  try {
    String domain = Urls.getDomainName(context.getFullRequestURL(), this.domainSuffix);
    if (domain == null) {
      domain = context.getServerName();
    }
    cookie.setDomain(domain);
  } catch (final Exception e) {
    throw new TechnicalException(e);
  }
  cookie.setHttpOnly(true);
  cookie.setSecure(ContextHelper.isHttpsOrSecure(context));
  context.addResponseCookie(cookie);
}
origin: io.ratpack/ratpack-pac4j

@Override
public Collection<Cookie> getRequestCookies() {
 final List<Cookie> newCookies = new ArrayList<>();
 final Set<io.netty.handler.codec.http.cookie.Cookie> cookies = request.getCookies();
 for (final io.netty.handler.codec.http.cookie.Cookie cookie : cookies) {
  final Cookie newCookie = new Cookie(cookie.name(), cookie.value());
  newCookie.setDomain(cookie.domain());
  newCookie.setPath(cookie.path());
  newCookie.setMaxAge((int) cookie.maxAge());
  newCookie.setSecure(cookie.isSecure());
  newCookie.setHttpOnly(cookie.isHttpOnly());
  newCookies.add(newCookie);
 }
 return newCookies;
}
origin: apache/knox

@Override
public void set(WebContext context, String key, Object value) {
  logger.debug("Save in session: {} = {}", key, value);
  final Cookie cookie = new Cookie(PAC4J_SESSION_PREFIX + key, compressEncryptBase64(value));
  try {
    String domain = Urls.getDomainName(context.getFullRequestURL(), this.domainSuffix);
    if (domain == null) {
      domain = context.getServerName();
    }
    cookie.setDomain(domain);
  } catch (final Exception e) {
    throw new TechnicalException(e);
  }
  cookie.setHttpOnly(true);
  cookie.setSecure(ContextHelper.isHttpsOrSecure(context));
  context.addResponseCookie(cookie);
}
origin: org.pac4j/play-pac4j-java

@Override
public Collection<Cookie> getRequestCookies() {
  final List<Cookie> cookies = new ArrayList<>();
  final Http.Cookies httpCookies = request.cookies();
  httpCookies.forEach(httpCookie -> {
    final Cookie cookie = new Cookie(httpCookie.name(), httpCookie.value());
    cookie.setDomain(httpCookie.domain());
    cookie.setHttpOnly(httpCookie.httpOnly());
    cookie.setMaxAge(httpCookie.maxAge());
    cookie.setPath(httpCookie.path());
    cookie.setSecure(httpCookie.secure());
    cookies.add(cookie);
  });
  return cookies;
}
origin: pac4j/play-pac4j

@Override
public Collection<Cookie> getRequestCookies() {
  final List<Cookie> cookies = new ArrayList<>();
  final Http.Cookies httpCookies = request.cookies();
  httpCookies.forEach(httpCookie -> {
    final Cookie cookie = new Cookie(httpCookie.name(), httpCookie.value());
    if(httpCookie.domain() != null) {
      cookie.setDomain(httpCookie.domain());
    }
    cookie.setHttpOnly(httpCookie.httpOnly());
    if(httpCookie.maxAge() != null) {
      cookie.setMaxAge(httpCookie.maxAge());
    }
    cookie.setPath(httpCookie.path());
    cookie.setSecure(httpCookie.secure());
    cookies.add(cookie);
  });
  return cookies;
}
origin: pac4j/play-pac4j

@Override
public Collection<Cookie> getRequestCookies() {
  final List<Cookie> cookies = new ArrayList<>();
  final Http.Cookies httpCookies = request.cookies();
  httpCookies.forEach(httpCookie -> {
    final Cookie cookie = new Cookie(httpCookie.name(), httpCookie.value());
    if(httpCookie.domain() != null) {
      cookie.setDomain(httpCookie.domain());
    }
    cookie.setHttpOnly(httpCookie.httpOnly());
    if(httpCookie.maxAge() != null) {
      cookie.setMaxAge(httpCookie.maxAge());
    }
    cookie.setPath(httpCookie.path());
    cookie.setSecure(httpCookie.secure());
    cookies.add(cookie);
  });
  return cookies;
}
org.pac4j.core.contextCookiesetHttpOnly

Popular methods of Cookie

  • <init>
  • getValue
  • getName
  • setDomain
  • setSecure
  • getDomain
  • getMaxAge
  • getPath
  • isHttpOnly
  • isSecure
  • setPath
  • setMaxAge
  • setPath,
  • setMaxAge,
  • getComment,
  • setComment,
  • setVersion,
  • getVersion

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JPanel (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now