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

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

Best Java code snippets using org.pac4j.core.context.Cookie.setSecure (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.contextCookiesetSecure

Popular methods of Cookie

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JList (javax.swing)
  • Top Vim 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