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

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

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

origin: jooby-project/jooby

@Override
public void addResponseCookie(final Cookie cookie) {
 Definition c = new Definition(cookie.getName(), cookie.getValue());
 Optional.ofNullable(cookie.getDomain()).ifPresent(c::domain);
 Optional.ofNullable(cookie.getPath()).ifPresent(c::path);
 c.httpOnly(cookie.isHttpOnly());
 c.maxAge(cookie.getMaxAge());
 c.secure(cookie.isSecure());
 rsp.cookie(c);
}
origin: jooby-project/jooby

@Override public void addResponseCookie(Cookie cookie) {
 org.jooby.Cookie.Definition c = new org.jooby.Cookie.Definition(cookie.getName(),
   cookie.getValue());
 Optional.ofNullable(cookie.getDomain()).ifPresent(c::domain);
 Optional.ofNullable(cookie.getPath()).ifPresent(c::path);
 c.httpOnly(cookie.isHttpOnly());
 c.maxAge(cookie.getMaxAge());
 c.secure(cookie.isSecure());
 rsp.cookie(c);
}
origin: pippo-java/pippo

@Override
public void addResponseCookie(Cookie cookie) {
  getResponse().cookie(cookie.getPath(),
    cookie.getDomain(),
    cookie.getName(),
    cookie.getValue(),
    cookie.getMaxAge(),
    cookie.isSecure()
  );
  javax.servlet.http.Cookie addedCookie = getResponse().getCookie(cookie.getName());
  addedCookie.setHttpOnly(cookie.isHttpOnly());
  addedCookie.setComment(cookie.getComment());
}
origin: org.pac4j/pac4j-http

@Override
public TokenCredentials extract(final WebContext context) {
  final Collection<Cookie> col = context.getRequestCookies();
  for (final Cookie c : col) {
    if (c.getName().equals(this.cookieName)) {
      return new TokenCredentials(c.getValue());
    }
  }
  return null;
}
origin: org.pac4j/vertx-pac4j

@Override
public void addResponseCookie(Cookie cookie) {
  routingContext.addCookie(io.vertx.ext.web.Cookie.cookie(cookie.getName(), cookie.getValue()));
}
origin: pac4j/vertx-pac4j

@Override
public void addResponseCookie(Cookie cookie) {
  routingContext.addCookie(io.vertx.ext.web.Cookie.cookie(cookie.getName(), cookie.getValue()));
}
origin: org.jooby/jooby-pac4j

@Override
public void addResponseCookie(final Cookie cookie) {
 Definition c = new Definition(cookie.getName(), cookie.getValue());
 Optional.ofNullable(cookie.getDomain()).ifPresent(c::domain);
 Optional.ofNullable(cookie.getPath()).ifPresent(c::path);
 c.httpOnly(cookie.isHttpOnly());
 c.maxAge(cookie.getMaxAge());
 c.secure(cookie.isSecure());
 rsp.cookie(c);
}
origin: io.ratpack/ratpack-pac4j

@Override
public void addResponseCookie(Cookie cookie) {
 final DefaultCookie newCookie = new DefaultCookie(cookie.getName(), cookie.getValue());
 newCookie.setDomain(cookie.getDomain());
 newCookie.setPath(cookie.getPath());
 if (cookie.getMaxAge() >= 0) {
  newCookie.setMaxAge(cookie.getMaxAge());
 }
 newCookie.setSecure(cookie.isSecure());
 newCookie.setHttpOnly(cookie.isHttpOnly());
 response.getCookies().add(newCookie);
}
origin: pac4j/jax-rs-pac4j

@Override
public void addResponseCookie(Cookie cookie) {
  CommonHelper.assertNotNull("cookie", cookie);
  // Note: expiry is not in servlet and is meant to be superseeded by
  // max-age, so we simply make it null
  NewCookie c = new NewCookie(cookie.getName(), cookie.getValue(), cookie.getPath(),
      cookie.getDomain(), cookie.getVersion(), cookie.getComment(), cookie.getMaxAge(), null,
      cookie.isSecure(), cookie.isHttpOnly());
  getAbortBuilder().cookie(c);
  getResponseHolder().addResponseCookie(c);
}
origin: pac4j/undertow-pac4j

@Override
public void addResponseCookie(final Cookie cookie) {
  final CookieImpl newCookie = new CookieImpl(cookie.getName(), cookie.getValue());
  newCookie.setComment(cookie.getComment());
  newCookie.setDomain(cookie.getDomain());
  newCookie.setPath(cookie.getPath());
  newCookie.setMaxAge(cookie.getMaxAge() < 0 ? null : cookie.getMaxAge());
  newCookie.setSecure(cookie.isSecure());
  newCookie.setHttpOnly(cookie.isHttpOnly());
  exchange.setResponseCookie(newCookie);
}
origin: pac4j/play-pac4j

@Override
public void addResponseCookie(final Cookie cookie) {
  final Http.CookieBuilder cookieBuilder =
      Http.Cookie.builder(cookie.getName(), cookie.getValue())
          .withPath(cookie.getPath())
          .withDomain(cookie.getDomain())
          .withSecure(cookie.isSecure())
          .withHttpOnly(cookie.isHttpOnly());
  // in Play, maxAge: Cookie duration in seconds (null for a transient cookie [value by default], 0 or less for one that expires now)
  // in pac4j, maxAge == -1 -> session cookie, 0 -> expires now, > 0, expires in x seconds
  final int maxAge = cookie.getMaxAge();
  if (maxAge != -1) {
    cookieBuilder.withMaxAge(Duration.of(maxAge, ChronoUnit.SECONDS));
  }
  final Http.Cookie responseCookie = cookieBuilder.build();
  response.setCookie(responseCookie);
}
origin: pac4j/play-pac4j

@Override
public void addResponseCookie(final Cookie cookie) {
  final Http.CookieBuilder cookieBuilder =
      Http.Cookie.builder(cookie.getName(), cookie.getValue())
          .withPath(cookie.getPath())
          .withDomain(cookie.getDomain())
          .withSecure(cookie.isSecure())
          .withHttpOnly(cookie.isHttpOnly());
  // in Play, maxAge: Cookie duration in seconds (null for a transient cookie [value by default], 0 or less for one that expires now)
  // in pac4j, maxAge == -1 -> session cookie, 0 -> expires now, > 0, expires in x seconds
  final int maxAge = cookie.getMaxAge();
  if (maxAge != -1) {
    cookieBuilder.withMaxAge(Duration.of(maxAge, ChronoUnit.SECONDS));
  }
  final Http.Cookie responseCookie = cookieBuilder.build();
  response.setCookie(responseCookie);
}
org.pac4j.core.contextCookiegetName

Popular methods of Cookie

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • Kernel (java.awt.image)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Path (java.nio.file)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Top plugins for WebStorm
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