{"componentChunkName":"component---src-templates-tag-js","path":"/tags/java/","result":{"data":{"site":{"siteMetadata":{"title":"LoginRadius Blog"}},"allMarkdownRemark":{"totalCount":5,"edges":[{"node":{"fields":{"slug":"/engineering/guest-post/add-authentication-to-play-framework-with-oidc-and-loginradius/"},"html":"<p>In this blog post, I will write a step-by-step tutorial to add Authentication to the Play Framework Application with OIDC and LoginRadius. I will be using <a href=\"http://www.pac4j.org/\">pac4j</a> and it's <a href=\"https://github.com/pac4j/play-pac4j\">play-pac4j</a> integration in this tutorial. Before jumping into the tutorial, let's learn about few concepts. </p>\n<h2 id=\"what-is-openid-connect-oidc-protocol\" style=\"position:relative;\"><a href=\"#what-is-openid-connect-oidc-protocol\" aria-label=\"what is openid connect oidc protocol permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is OpenID Connect (OIDC) Protocol?</h2>\n<p>OIDC is an authentication protocol that allows users to verify their identity when they are trying to access a protected HTTPS endpoint. OIDC is an evolutionary development of ideas implemented earlier in OAuth and OpenID.</p>\n<p>OpenID Connect allows clients to request and receive information about authenticated sessions and end-users. It allows all types of clients, including </p>\n<ul>\n<li>Web-based</li>\n<li>Mobile</li>\n<li>Javascript clients etc...</li>\n</ul>\n<p>You can find out more details about <a href=\"https://openid.net/connect/\">OIDC here</a></p>\n<h2 id=\"what-is-play-framework\" style=\"position:relative;\"><a href=\"#what-is-play-framework\" aria-label=\"what is play framework permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Play Framework?</h2>\n<p>Play Framework is an open-source web application framework that follows the model–view–controller architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM Bytecode.</p>\n<p>It makes it easy to build web applications with Java &#x26; Scala. Play is based on a lightweight, stateless, web-friendly architecture. Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.</p>\n<h2 id=\"what-is-pac4j\" style=\"position:relative;\"><a href=\"#what-is-pac4j\" aria-label=\"what is pac4j permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is pac4j?</h2>\n<p><a href=\"http://www.pac4j.org/\">pac4j</a> is an easy and powerful security engine for Java to authenticate users, get their profiles and manage authorizations in order to secure web applications and web services.</p>\n<p>It provides a comprehensive set of concepts and components. It is based on Java and available under the Apache 2 license. It is available for most frameworks/tools and supports most authentication/authorization mechanisms.</p>\n<p>pac4j is supported with most of the Java frameworks like</p>\n<ul>\n<li>Spring Web MVC </li>\n<li>Spring Boot </li>\n<li>Spring Security (Spring Boot) </li>\n<li>Play 2.x </li>\n<li>Vertx Spark Java </li>\n<li>Javalin  </li>\n<li>Dropwizard </li>\n<li>Lagom </li>\n<li>Akka HTTP &#x26; many more...</li>\n</ul>\n<h2 id=\"getting-started\" style=\"position:relative;\"><a href=\"#getting-started\" aria-label=\"getting started permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Getting started</h2>\n<p>There are multiple options you can get started with the Play framework. </p>\n<ul>\n<li>You can create a new Play project by downloading the <a href=\"https://playframework.com/download#starters\">starter project here</a></li>\n<li>Create a new Play application using <code>sbt</code>.</li>\n</ul>\n<p>For this tutorial, I will be using creating a new play project using <code>sbt</code>.</p>\n<h3 id=\"install-sbt-on-mac-os\" style=\"position:relative;\"><a href=\"#install-sbt-on-mac-os\" aria-label=\"install sbt on mac os permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Install sbt on Mac OS</h3>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">brew install sbt</span></code></pre>\n<p>You can find <a href=\"https://www.scala-sbt.org/release/docs/Setup.html\">Installation steps for Windows and Linux</a> here.</p>\n<h3 id=\"prerequisites\" style=\"position:relative;\"><a href=\"#prerequisites\" aria-label=\"prerequisites permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Prerequisites</h3>\n<p>For this tutorial, I will be using </p>\n<ul>\n<li>Java 11</li>\n<li>sbt - 1.5.3</li>\n<li>play-pac4j - 11.0.0-PLAY2.8</li>\n<li>pac4j-oidc - 5.1.0</li>\n</ul>\n<h2 id=\"create-new-play-project\" style=\"position:relative;\"><a href=\"#create-new-play-project\" aria-label=\"create new play project permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create New Play Project</h2>\n<p>Create a new java play project using the following command</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">sbt new playframework/play-java-seed.g8</span></code></pre>\n<p>The above command will prompt you to fill in the project <code>name</code> and project package structure in <code>organization</code> as shown below.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">[info] welcome to sbt 1.5.3 (Oracle Corporation Java 11.0.2)</span>\n<span class=\"grvsc-line\">[info] set current project to new (in build file:/private/var/folders/_9/rcqwq2vx1cl_1sc4xdhb5_5c0000gn/T/sbt_661d1bf7/new/)</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">This template generates a Play Java project</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">name [play-java-seed]: loginradius-play-oidc</span>\n<span class=\"grvsc-line\">organization [com.example]: com.loginradius.developer</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">Template applied in /Users/vishnuchilamakuru/self/longinradius/./loginradius-play-oidc</span></code></pre>\n<h2 id=\"run-play-project\" style=\"position:relative;\"><a href=\"#run-play-project\" aria-label=\"run play project permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Run Play Project</h2>\n<p>Now that the project is created with a base template. You can test it by running the project using the following command from <code>loginradius-play-oidc</code> folder.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"console\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">sbt run</span></code></pre>\n<p>Now visit <code>http://localhost:9000</code>, and it should look like this.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 55.53846153846153%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAvUlEQVQoz+WPUQuDIBSF/f//bODDKBZNM22SL5WxoIiozlLWnlassbcdOFzRez/PJfx8AuUUqZaQUiFNJfLcwNY1rLVQN42IJUhkBiYUrkKCpwpsw6RtW3RdB1eHYUDf9xjH0d85YFVVvhZF4X1vGkzT5HvemcRxDCEElMpgjIHWGpcoQlmWmOfZD78Az/OeCeccYRgiCAIwxhawAqV0WTuHk4MeEdl7dLCjJlvR12Rr48cJ9377+crf6A+BD5SBXJjm2F2yAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"play-project-homepage.png\"\n        title=\"play-project-homepage.png\"\n        src=\"/static/98136bf03eb0d8319d556f6a7ba1237c/e5715/play-project-homepage.png\"\n        srcset=\"/static/98136bf03eb0d8319d556f6a7ba1237c/a6d36/play-project-homepage.png 650w,\n/static/98136bf03eb0d8319d556f6a7ba1237c/e5715/play-project-homepage.png 768w,\n/static/98136bf03eb0d8319d556f6a7ba1237c/ccf0c/play-project-homepage.png 1428w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h2 id=\"integrate-pac4j-with-play-project\" style=\"position:relative;\"><a href=\"#integrate-pac4j-with-play-project\" aria-label=\"integrate pac4j with play project permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Integrate pac4j with Play Project</h2>\n<h3 id=\"1-add-pac4j-dependencies-to-buildsbt\" style=\"position:relative;\"><a href=\"#1-add-pac4j-dependencies-to-buildsbt\" aria-label=\"1 add pac4j dependencies to buildsbt permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Add pac4j dependencies to <code>build.sbt</code></h3>\n<p>Add pac4j dependencies, Java 11 as required, and target version to compile the project in <code>build.sbt</code>.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"scala\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">name := &quot;&quot;&quot;loginradius-play-oidc&quot;&quot;&quot;</span>\n<span class=\"grvsc-line\">organization := &quot;com.loginradius.developer&quot;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">version := &quot;1.0-SNAPSHOT&quot;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">lazy val root = (project in file(&quot;.&quot;)).enablePlugins(PlayJava)</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">scalaVersion := &quot;2.13.6&quot;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">initialize := {</span>\n<span class=\"grvsc-line\">  val _ = initialize.value // run the previous initialization</span>\n<span class=\"grvsc-line\">  val required = &quot;11&quot;</span>\n<span class=\"grvsc-line\">  val current  = sys.props(&quot;java.specification.version&quot;)</span>\n<span class=\"grvsc-line\">  assert(current == required, s&quot;Unsupported JDK: java.specification.version $current != $required&quot;)</span>\n<span class=\"grvsc-line\">}</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">scalacOptions += &quot;-target:jvm-11&quot;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">javacOptions ++= Seq(&quot;-source&quot;, &quot;11&quot;, &quot;-target&quot;, &quot;11&quot;)</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">libraryDependencies ++= Seq(</span>\n<span class=\"grvsc-line\">  guice,</span>\n<span class=\"grvsc-line\">  ehcache,</span>\n<span class=\"grvsc-line\">  &quot;org.pac4j&quot; %% &quot;play-pac4j&quot; % &quot;11.0.0-PLAY2.8&quot;,</span>\n<span class=\"grvsc-line\">  &quot;org.pac4j&quot; % &quot;pac4j-oidc&quot; % &quot;5.1.0&quot;,</span>\n<span class=\"grvsc-line\">  &quot;com.typesafe.play&quot; % &quot;play-cache_2.13&quot; % &quot;2.8.8&quot;,</span>\n<span class=\"grvsc-line\">  &quot;com.fasterxml.jackson.module&quot; %% &quot;jackson-module-scala&quot; % &quot;2.12.3&quot;</span>\n<span class=\"grvsc-line\">)</span></code></pre>\n<h3 id=\"2-create-security-module\" style=\"position:relative;\"><a href=\"#2-create-security-module\" aria-label=\"2 create security module permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Create Security Module</h3>\n<p>Create <code>app/modules/SecurityModule.java</code>. This class configures OIDC, sets up a secure HttpActionAdapter, and registers callback and logout controllers.</p>\n<ul>\n<li>SecurityModule.java</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">package</span><span class=\"mtk1\"> modules;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> com.google.inject.AbstractModule;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> com.nimbusds.oauth2.sdk.ParseException;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> com.typesafe.config.Config;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> net.minidev.json.JSONObject;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.core.authorization.authorizer.RequireAnyRoleAuthorizer;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.core.client.Clients;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.core.context.session.SessionStore;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.oidc.client.OidcClient;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.oidc.config.OidcConfiguration;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.play.CallbackController;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.play.LogoutController;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.play.http.PlayHttpActionAdapter;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.play.store.PlayCacheSessionStore;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> play.Environment;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> java.util.Optional;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk4\">class</span><span class=\"mtk1\"> </span><span class=\"mtk10\">SecurityModule</span><span class=\"mtk1\"> </span><span class=\"mtk4\">extends</span><span class=\"mtk1\"> </span><span class=\"mtk10\">AbstractModule</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">private</span><span class=\"mtk1\"> </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Config</span><span class=\"mtk1\"> </span><span class=\"mtk12\">configuration</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk11\">SecurityModule</span><span class=\"mtk1\">(</span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Environment</span><span class=\"mtk1\"> </span><span class=\"mtk12\">environment</span><span class=\"mtk1\">, </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Config</span><span class=\"mtk1\"> </span><span class=\"mtk12\">configuration</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">configuration</span><span class=\"mtk1\"> = configuration;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    @</span><span class=\"mtk10\">Override</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">protected</span><span class=\"mtk1\"> </span><span class=\"mtk10\">void</span><span class=\"mtk1\"> </span><span class=\"mtk11\">configure</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk11\">bind</span><span class=\"mtk1\">(</span><span class=\"mtk12\">SessionStore</span><span class=\"mtk1\">.</span><span class=\"mtk12\">class</span><span class=\"mtk1\">).</span><span class=\"mtk11\">to</span><span class=\"mtk1\">(</span><span class=\"mtk12\">PlayCacheSessionStore</span><span class=\"mtk1\">.</span><span class=\"mtk12\">class</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">OidcConfiguration</span><span class=\"mtk1\"> </span><span class=\"mtk12\">oidcConfiguration</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">OidcConfiguration</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">oidcConfiguration</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setDiscoveryURI</span><span class=\"mtk1\">(</span><span class=\"mtk12\">configuration</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getString</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;oidc.discoveryUri&quot;</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">oidcConfiguration</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setClientId</span><span class=\"mtk1\">(</span><span class=\"mtk12\">configuration</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getString</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;oidc.clientId&quot;</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">oidcConfiguration</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setSecret</span><span class=\"mtk1\">(</span><span class=\"mtk12\">configuration</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getString</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;oidc.clientSecret&quot;</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">oidcConfiguration</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setClientAuthenticationMethod</span><span class=\"mtk1\">(</span><span class=\"mtk12\">ClientAuthenticationMethod</span><span class=\"mtk1\">.</span><span class=\"mtk12\">CLIENT_SECRET_BASIC</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk11\">addProviderMetadata</span><span class=\"mtk1\">(oidcConfiguration);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">OidcClient</span><span class=\"mtk1\"> </span><span class=\"mtk12\">oidcClient</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">OidcClient</span><span class=\"mtk1\">(oidcConfiguration);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">oidcClient</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addAuthorizationGenerator</span><span class=\"mtk1\">((ctx, session, profile) </span><span class=\"mtk4\">-&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">profile</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addRole</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;ROLE_ADMIN&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Optional</span><span class=\"mtk1\">.</span><span class=\"mtk11\">of</span><span class=\"mtk1\">(profile);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        });</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">baseUrl</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">configuration</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getString</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;baseUrl&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Clients</span><span class=\"mtk1\"> </span><span class=\"mtk12\">clients</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">Clients</span><span class=\"mtk1\">(baseUrl + </span><span class=\"mtk8\">&quot;/callback&quot;</span><span class=\"mtk1\">,  oidcClient);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">org</span><span class=\"mtk1\">.</span><span class=\"mtk10\">pac4j</span><span class=\"mtk1\">.</span><span class=\"mtk10\">core</span><span class=\"mtk1\">.</span><span class=\"mtk10\">config</span><span class=\"mtk1\">.</span><span class=\"mtk10\">Config</span><span class=\"mtk1\"> </span><span class=\"mtk12\">config</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> org.pac4j.core.config.</span><span class=\"mtk11\">Config</span><span class=\"mtk1\">(clients);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">config</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addAuthorizer</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;admin&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">RequireAnyRoleAuthorizer</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;ROLE_ADMIN&quot;</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">config</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setHttpActionAdapter</span><span class=\"mtk1\">(</span><span class=\"mtk12\">PlayHttpActionAdapter</span><span class=\"mtk1\">.</span><span class=\"mtk12\">INSTANCE</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk11\">bind</span><span class=\"mtk1\">(</span><span class=\"mtk12\">org</span><span class=\"mtk1\">.</span><span class=\"mtk12\">pac4j</span><span class=\"mtk1\">.</span><span class=\"mtk12\">core</span><span class=\"mtk1\">.</span><span class=\"mtk12\">config</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Config</span><span class=\"mtk1\">.</span><span class=\"mtk12\">class</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toInstance</span><span class=\"mtk1\">(config);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk3\">// callback</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">CallbackController</span><span class=\"mtk1\"> </span><span class=\"mtk12\">callbackController</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">CallbackController</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">callbackController</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setDefaultUrl</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk11\">bind</span><span class=\"mtk1\">(</span><span class=\"mtk12\">CallbackController</span><span class=\"mtk1\">.</span><span class=\"mtk12\">class</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toInstance</span><span class=\"mtk1\">(callbackController);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk3\">// logout</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">LogoutController</span><span class=\"mtk1\"> </span><span class=\"mtk12\">logoutController</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">LogoutController</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">logoutController</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setDefaultUrl</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/?defaulturlafterlogout&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk11\">bind</span><span class=\"mtk1\">(</span><span class=\"mtk12\">LogoutController</span><span class=\"mtk1\">.</span><span class=\"mtk12\">class</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toInstance</span><span class=\"mtk1\">(logoutController);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">private</span><span class=\"mtk1\"> </span><span class=\"mtk10\">void</span><span class=\"mtk1\"> </span><span class=\"mtk11\">addProviderMetadata</span><span class=\"mtk1\">(</span><span class=\"mtk10\">OidcConfiguration</span><span class=\"mtk1\"> </span><span class=\"mtk12\">oidcConfiguration</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk10\">JSONObject</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jsonObj</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">JSONObject</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">jsonObj</span><span class=\"mtk1\">.</span><span class=\"mtk11\">appendField</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;token_endpoint&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">configuration</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getString</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;oidc.tokenUri&quot;</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">OIDCProviderMetadata</span><span class=\"mtk1\"> </span><span class=\"mtk12\">providerMetaData</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">try</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            providerMetaData = </span><span class=\"mtk12\">OIDCProviderMetadata</span><span class=\"mtk1\">.</span><span class=\"mtk11\">parse</span><span class=\"mtk1\">(jsonObj);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">oidcConfiguration</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setProviderMetadata</span><span class=\"mtk1\">(providerMetaData);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        } </span><span class=\"mtk15\">catch</span><span class=\"mtk1\"> (</span><span class=\"mtk10\">ParseException</span><span class=\"mtk1\"> </span><span class=\"mtk12\">e</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk11\">printStackTrace</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<h3 id=\"3-create-secured-endpoint-in-controller\" style=\"position:relative;\"><a href=\"#3-create-secured-endpoint-in-controller\" aria-label=\"3 create secured endpoint in controller permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Create Secured Endpoint in Controller</h3>\n<p>In <code>app/controllers/HomeController.java</code> add the following methods</p>\n<ul>\n<li>A method that is secured by the OIDC client</li>\n<li>A method to show the profile information returned from LoginRadius(or any identity provider) on successful login.</li>\n<li>A method to get profile information</li>\n</ul>\n<p>After adding the above methods <code>HomeController.java</code> looks like this.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">package</span><span class=\"mtk1\"> controllers;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> com.google.inject.Inject;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.core.context.session.SessionStore;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.core.profile.ProfileManager;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.core.profile.UserProfile;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.play.context.PlayContextFactory;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.play.java.Secure;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.pac4j.play.store.PlayCacheSessionStore;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> play.mvc.*;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> java.util.ArrayList;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> java.util.List;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/**</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\"> * This controller contains an action to handle HTTP requests</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\"> * to the application&#39;s home page.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\"> */</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk4\">class</span><span class=\"mtk1\"> </span><span class=\"mtk10\">HomeController</span><span class=\"mtk1\"> </span><span class=\"mtk4\">extends</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Controller</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">    /**</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">     * An action that renders an HTML page with a welcome message.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">     * The configuration in the &lt;code&gt;routes&lt;/code&gt; file means that</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">     * this method will be called when the application receives a</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">     * &lt;code&gt;GET&lt;/code&gt; request with a path of &lt;code&gt;/&lt;/code&gt;.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">     */</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Result</span><span class=\"mtk1\"> </span><span class=\"mtk11\">index</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ok</span><span class=\"mtk1\">(</span><span class=\"mtk12\">views</span><span class=\"mtk1\">.</span><span class=\"mtk12\">html</span><span class=\"mtk1\">.</span><span class=\"mtk12\">index</span><span class=\"mtk1\">.</span><span class=\"mtk11\">render</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    @</span><span class=\"mtk10\">Secure</span><span class=\"mtk1\">(clients = </span><span class=\"mtk8\">&quot;OidcClient&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Result</span><span class=\"mtk1\"> </span><span class=\"mtk11\">oidcIndex</span><span class=\"mtk1\">(</span><span class=\"mtk10\">Http</span><span class=\"mtk1\">.</span><span class=\"mtk10\">Request</span><span class=\"mtk1\"> </span><span class=\"mtk12\">req</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk11\">protectedIndex</span><span class=\"mtk1\">(req);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Result</span><span class=\"mtk1\"> </span><span class=\"mtk11\">protectedIndex</span><span class=\"mtk1\">(</span><span class=\"mtk10\">Http</span><span class=\"mtk1\">.</span><span class=\"mtk10\">Request</span><span class=\"mtk1\"> </span><span class=\"mtk12\">req</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ok</span><span class=\"mtk1\">(</span><span class=\"mtk12\">views</span><span class=\"mtk1\">.</span><span class=\"mtk12\">html</span><span class=\"mtk1\">.</span><span class=\"mtk12\">protectedindex</span><span class=\"mtk1\">.</span><span class=\"mtk11\">render</span><span class=\"mtk1\">(</span><span class=\"mtk11\">getProfiles</span><span class=\"mtk1\">(req)));</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    @</span><span class=\"mtk10\">Inject</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">private</span><span class=\"mtk1\"> </span><span class=\"mtk10\">SessionStore</span><span class=\"mtk1\"> </span><span class=\"mtk12\">sessionStore</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">private</span><span class=\"mtk1\"> </span><span class=\"mtk10\">List</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">UserProfile</span><span class=\"mtk1\">&gt; </span><span class=\"mtk11\">getProfiles</span><span class=\"mtk1\">(</span><span class=\"mtk10\">Http</span><span class=\"mtk1\">.</span><span class=\"mtk10\">Request</span><span class=\"mtk1\"> </span><span class=\"mtk12\">req</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">ProfileManager</span><span class=\"mtk1\"> </span><span class=\"mtk12\">profileManager</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ProfileManager</span><span class=\"mtk1\">(</span><span class=\"mtk12\">PlayContextFactory</span><span class=\"mtk1\">.</span><span class=\"mtk12\">INSTANCE</span><span class=\"mtk1\">.</span><span class=\"mtk11\">newContext</span><span class=\"mtk1\">(req), sessionStore);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">List</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">UserProfile</span><span class=\"mtk1\">&gt; </span><span class=\"mtk12\">profiles</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">ArrayList</span><span class=\"mtk1\">&lt;&gt;();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">profileManager</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getProfile</span><span class=\"mtk1\">().</span><span class=\"mtk11\">isPresent</span><span class=\"mtk1\">()) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk12\">profiles</span><span class=\"mtk1\">.</span><span class=\"mtk11\">add</span><span class=\"mtk1\">(</span><span class=\"mtk12\">profileManager</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getProfile</span><span class=\"mtk1\">().</span><span class=\"mtk11\">get</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> profiles;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<h3 id=\"4-create-views\" style=\"position:relative;\"><a href=\"#4-create-views\" aria-label=\"4 create views permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. Create Views</h3>\n<ul>\n<li>Update <code>app/views/index.scala.html</code> as follows to add the link protected by OIDC authentication.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">@()</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">@</span><span class=\"mtk11\">main</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Welcome to Play&quot;</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">h1</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Welcome to Play!</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">h1</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">a</span><span class=\"mtk1\"> </span><span class=\"mtk12\">href</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;oidc/index.html&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Protected URL by OIDC</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">a</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<ul>\n<li>Add <code>app/views/protectedindex.scala.html</code> with the following content below. This page will be shown after Successful Login using OIDC in LoginRadius.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"html\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">@(</span><span class=\"mtk12\">profileList</span><span class=\"mtk1\">: </span><span class=\"mtk10\">java</span><span class=\"mtk1\">.</span><span class=\"mtk10\">util</span><span class=\"mtk1\">.</span><span class=\"mtk10\">List</span><span class=\"mtk1\">[</span><span class=\"mtk10\">org</span><span class=\"mtk1\">.</span><span class=\"mtk10\">pac4j</span><span class=\"mtk1\">.</span><span class=\"mtk10\">core</span><span class=\"mtk1\">.</span><span class=\"mtk10\">profile</span><span class=\"mtk1\">.</span><span class=\"mtk10\">UserProfile</span><span class=\"mtk1\">])</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">@import scala.collection.JavaConverters._</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">@profiles() = { @profileList.</span><span class=\"mtk12\">toList</span><span class=\"mtk1\"> }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">h1</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Protected Area</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">h1</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">a</span><span class=\"mtk1\"> </span><span class=\"mtk12\">href</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;..&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Back</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">a</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">ul</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">li</span><span class=\"mtk17\">&gt;&lt;</span><span class=\"mtk4\">a</span><span class=\"mtk1\"> </span><span class=\"mtk12\">href</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;/logout?url=/?forcepostlogouturl&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Logout</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">a</span><span class=\"mtk17\">&gt;&lt;/</span><span class=\"mtk4\">li</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">ul</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    profiles: @profiles</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">p</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<h3 id=\"5-configure-routes\" style=\"position:relative;\"><a href=\"#5-configure-routes\" aria-label=\"5 configure routes permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>5. Configure Routes</h3>\n<p>Now we already added methods in <code>HomeController.java</code> and configured callback, logout controllers in <code>SecurityModule.java</code>. Let's configure the routes to map to these methods in <code>conf/routes</code>.</p>\n<ul>\n<li><code>conf/routes</code> will look like this.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"scala\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"># Routes</span>\n<span class=\"grvsc-line\"># This file defines all application routes (Higher priority routes first)</span>\n<span class=\"grvsc-line\"># ~~~~</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"># An example controller showing a sample home page</span>\n<span class=\"grvsc-line\">GET     /                           controllers.HomeController.index</span>\n<span class=\"grvsc-line\">GET     /oidc/index.html            controllers.HomeController.oidcIndex(request: Request)</span>\n<span class=\"grvsc-line\">GET     /protected/index.html       controllers.HomeController.protectedIndex(request: Request)</span>\n<span class=\"grvsc-line\">GET     /callback                   @org.pac4j.play.CallbackController.callback(request: Request)</span>\n<span class=\"grvsc-line\">POST    /callback                   @org.pac4j.play.CallbackController.callback(request: Request)</span>\n<span class=\"grvsc-line\">GET     /logout                     @org.pac4j.play.LogoutController.logout(request: Request)</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"># Map static resources from the /public folder to the /assets URL path</span>\n<span class=\"grvsc-line\">GET     /assets/*file               controllers.Assets.versioned(path=&quot;/public&quot;, file: Asset)</span></code></pre>\n<h3 id=\"6-add-application-configuration-variables\" style=\"position:relative;\"><a href=\"#6-add-application-configuration-variables\" aria-label=\"6 add application configuration variables permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>6. Add Application Configuration variables</h3>\n<p>Finally, configure the variables mentioned in <code>SecurityModule.java</code> in <code>conf/application.conf</code> as follows.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"scala\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">play {</span>\n<span class=\"grvsc-line\">  modules {</span>\n<span class=\"grvsc-line\">    enabled += modules.SecurityModule</span>\n<span class=\"grvsc-line\">  }</span>\n<span class=\"grvsc-line\">}</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">baseUrl = &quot;http://localhost:9000&quot;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">oidc.discoveryUri = &quot;https://cloud-api.loginradius.com/sso/oidc/v2/{loginradius-site-name}/{loginradius-app-name}/.well-known/openid-configuration&quot;</span>\n<span class=\"grvsc-line\">oidc.clientId = &quot;{clientId}&quot;</span>\n<span class=\"grvsc-line\">oidc.clientSecret = &quot;{clientSecret}&quot;</span>\n<span class=\"grvsc-line\">oidc.tokenUri = &quot;https://cloud-api.loginradius.com/sso/oidc/v2/{loginradius-site-name}/token&quot;</span></code></pre>\n<h2 id=\"create-an-oidc-app-in-loginradius\" style=\"position:relative;\"><a href=\"#create-an-oidc-app-in-loginradius\" aria-label=\"create an oidc app in loginradius permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Create an OIDC app in LoginRadius</h2>\n<p>Login to your LoginRadius account or <a href=\"https://www.loginradius.com/\">signup here</a> if you don't have one. </p>\n<p>Once you log in you can see by default, one application will be created for you. Otherwise, you can create a new application here from the following screen by clicking <code>New App</code>.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 65.6923076923077%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAABYlAAAWJQFJUiTwAAABR0lEQVQ4y61S2U7DMBDM/z+TNgJRrlQ9QQheeCj8DagFEXLbju0Mu27aRIiqQcLSyLs+ZmcP7272guXkGYvxivYVwut7TMcPhEdcnM8RDEL4wykGhMAPMfRvHPxghpNgjtOzBS5HS1yNFridPMGLdA1pDf5reXGS4fVtjfX6HUUpIKSEELQL2dgSUiporXvAwCvpMztSKVRV5aBU1doEvudV1/VReKzgt8WXaGCtdXBnR4i9ktKsO5+sJZt8TjtOEkJKdok8Lyh12QY7VEMmbKPu1AGSCDcfn9hEMQz527qKfgr3LFvDXbCaPM+RZjkKaoooS9ec3go5zUyZ/WNWk6QpFHWOgxljHP5EKHVbeFYYRV9ulHYkXOPehOg8qhtFP7vbtXs2pQXPYkF1q/Q2TQ7QnceDhLvOtWNj9woVDbs2pvFtr5S/AXDE7uVD3HNaAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"loginradius-dashboard.png\"\n        title=\"loginradius-dashboard.png\"\n        src=\"/static/19ce2c82b61d0cbc22b842b0b1158fb8/e5715/loginradius-dashboard.png\"\n        srcset=\"/static/19ce2c82b61d0cbc22b842b0b1158fb8/a6d36/loginradius-dashboard.png 650w,\n/static/19ce2c82b61d0cbc22b842b0b1158fb8/e5715/loginradius-dashboard.png 768w,\n/static/19ce2c82b61d0cbc22b842b0b1158fb8/78302/loginradius-dashboard.png 2798w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>I will be using the existing application itself for this demo as I am using a free plan. In the free plan, you can create only one application (no need for card details).</p>\n<p>Upgrade your application subscription to the <code>Developer Pro</code> Plan to configure OIDC. (<code>Developer Pro</code> Plan is available with 21 days trial).</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 77.6923076923077%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAYAAAAWGF8bAAAACXBIWXMAABYlAAAWJQFJUiTwAAABxUlEQVQ4y41TWS8DURid/8cDsSRVRVCCSFpLI0UiEQ0SiQdC4okQ3iTibxAPlsT6JNZROtPZ7twe95vNVKfLl5y5y9x7vvMtVxpI5DDYvYyBrhySYkwmVhDrmEAilkJ/T8ZBb3wSna2jaGlKoqV5qCakJ7mI53wRPwUFZLLOYDAOlErgNgfnhBIaNUlVVRDy399QxCiYBFd1kAPbtmHzaEiKoqIg1L2+vePjU4am6y40H5oHd25ZVk2HkqsKTliBdwFGYLYXsgu6ELaahP5G6LjzJUWGYcAwTei6q1ItFmGKtX+vLIcUsp+bMEgl2frmFobH00hNZzGVncfswiImZ+awd3DkRcbLFRYUpaJSYbW51TW0x/swksrg4fEJX195ketPXF7fREYWEAY/Qt7IFpaW0dwWQ3IsjZfXt0D57d19fcKQxGB9fHKKje0d7O4f4uz8wlFGuKqnkMwWlZY1Bu4doPwYhgk6Y1g2LEaVZ86eKYpVl5CIdPFKwoS6qLAizpimFbQWkTIv9MZC9lom6ElB4M9JGXWG1YjCPypUEv5rbFpHEvp9GAUio4amkDWRN+7tW8IBpSCaMHh6vCqYo7RyP4rwF+S4sMVgf10uAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"loginradius-upgrade-subscription-1.png\"\n        title=\"loginradius-upgrade-subscription-1.png\"\n        src=\"/static/5c1a296411b3ae0135c3faddf34ac8a2/e5715/loginradius-upgrade-subscription-1.png\"\n        srcset=\"/static/5c1a296411b3ae0135c3faddf34ac8a2/a6d36/loginradius-upgrade-subscription-1.png 650w,\n/static/5c1a296411b3ae0135c3faddf34ac8a2/e5715/loginradius-upgrade-subscription-1.png 768w,\n/static/5c1a296411b3ae0135c3faddf34ac8a2/037ab/loginradius-upgrade-subscription-1.png 2274w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 69.6923076923077%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAAACXBIWXMAABYlAAAWJQFJUiTwAAAB+0lEQVQ4y42TzW8SQRiH+d8aNZrGphSs8WLSkxdj+eqys98CBT+uhpiiRxL16AWUiz1bOJF4EE1Mq12uWsTdhZ/vO8suUmgsyZN3Zph9+M3OSyK1uYtbmw+Qvnkft5MZbG3cw/qNO0hv7SCV3EFy4y6uX9vGlbUUrq6l/0tCMTQouoBpaXDKNqyHNvb3y6hUSjHVagXVWmVez8Pr1bIkUVSKUIhsNi+roRvQNI3QY4QQUFUh14XQ5DysIbquE4YkUSyqMIxIEop4QyijOY0dx0GpxGk5SQ212iNiXm3bhmmahBUKLcu6EP6xD4eH+HZ8gs+DLzg++Q53OMSp68J1h/hx6qJer8vUvF8KQ/synDRfKKDf7+Oiz8gLcNBoQKiqTLqU0IwqC+nI2VweH4+OMJ1O4fs+JpPJAp7noUFC9byQBQvimbBACbvdXvwwi/8VBkGwLIxSGSwxzFjIl6IoCrq9HgJ6+A8JfRJwUhbx2tjzVwhn6YRuSkIhzUmYy+XQIyFLfp2dYTQaScbjMb3BCTG9/JEZ3jgYDFZeyKefwOuvv3Hw4uWKSzHnkkhozG662Wyi0+mg1Wqh3W6jRXTev8OzV2+x+/wNHj95Su2lX65tuL+4dfjoTCaTicdirwBH3ZP7ohALR14FNzZ/z/8WPhLDYzknLNtZeGV/AY5b/JlWBK13AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"loginradius-upgrade-subscription-2.png\"\n        title=\"loginradius-upgrade-subscription-2.png\"\n        src=\"/static/6b180247c629f7ccad7e90c2f9568ef5/e5715/loginradius-upgrade-subscription-2.png\"\n        srcset=\"/static/6b180247c629f7ccad7e90c2f9568ef5/a6d36/loginradius-upgrade-subscription-2.png 650w,\n/static/6b180247c629f7ccad7e90c2f9568ef5/e5715/loginradius-upgrade-subscription-2.png 768w,\n/static/6b180247c629f7ccad7e90c2f9568ef5/52a2d/loginradius-upgrade-subscription-2.png 2534w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Now click on <code>Select &#x26; Configure</code> on your application and navigate to the <code>Integration</code> Section and Configure <code>Open ID</code> configuration. You can find step-by-step details to <a href=\"https://www.loginradius.com/developers/\">configure OIDC</a> here.</p>\n<p>Once you configure these <code>conf/application.conf</code> will look something like this.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"scala\" data-index=\"11\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"># This is the main configuration file for the application.</span>\n<span class=\"grvsc-line\"># https://www.playframework.com/documentation/latest/ConfigFile</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">play {</span>\n<span class=\"grvsc-line\">  modules {</span>\n<span class=\"grvsc-line\">    enabled += modules.SecurityModule</span>\n<span class=\"grvsc-line\">  }</span>\n<span class=\"grvsc-line\">}</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">baseUrl = &quot;http://localhost:9000&quot;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">oidc.discoveryUri = &quot;https://cloud-api.loginradius.com/sso/oidc/v2/dev-svv3qlcj2y/pac4j-play-loginradius-demo/.well-known/openid-configuration&quot;</span>\n<span class=\"grvsc-line\">oidc.clientId = &quot;8ce24413-9b7e-4282-9f5b-e0e5ec13a42a&quot;</span>\n<span class=\"grvsc-line\">oidc.clientSecret = &quot;c9c61f6e-325f-40d6-89fd-696d17f970eb&quot;</span>\n<span class=\"grvsc-line\">oidc.tokenUri = &quot;https://cloud-api.loginradius.com/sso/oidc/v2/dev-svv3qlcj2y/token&quot;</span>\n<span class=\"grvsc-line\"># Site Name - dev-svv3qlcj2y</span>\n<span class=\"grvsc-line\"># App Name - pac4j-play-loginradius-demo</span></code></pre>\n<h2 id=\"time-to-test-complete-integration\" style=\"position:relative;\"><a href=\"#time-to-test-complete-integration\" aria-label=\"time to test complete integration permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Time to test complete Integration</h2>\n<p>Let's run our application using <code>sbt clean run</code> and visit <code>http://localhost:9000</code>. The Home page will look like this.</p>\n<h3 id=\"home-page\" style=\"position:relative;\"><a href=\"#home-page\" aria-label=\"home page permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Home Page</h3>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 27.692307692307693%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAbUlEQVQY062OwQqAIBBE9/8/0OoUdRbRrURDncxTWERCAw922WF5JKWE1hpKKRhjYJixrGuZnfOIMSKEkIkv5PvZ2xjUdwOmcYYQojytk1L6Tu6T5R2WPcr28KApuU+1SbNVBd2MEtrNLiH8nAPPEtpLdJBSVwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"home-page.png\"\n        title=\"home-page.png\"\n        src=\"/static/a6ab822950175d12e45d43fb76ca2967/e5715/home-page.png\"\n        srcset=\"/static/a6ab822950175d12e45d43fb76ca2967/a6d36/home-page.png 650w,\n/static/a6ab822950175d12e45d43fb76ca2967/e5715/home-page.png 768w,\n/static/a6ab822950175d12e45d43fb76ca2967/cbe7f/home-page.png 2420w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h3 id=\"loginradius-auth-page-idx\" style=\"position:relative;\"><a href=\"#loginradius-auth-page-idx\" aria-label=\"loginradius auth page idx permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>LoginRadius Auth Page (IDX)</h3>\n<p>Now click on the <code>protected url by OIDC</code> link on the home page that will redirect you to the LoginRadius Auth Page (IDX), which you configured.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 61.07692307692307%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAABYlAAAWJQFJUiTwAAACXElEQVQoz3WTS2sTURiGTyZp00xm0twvzT12YhNTklJrIdWFBcG0tQ2Iim5EV/4CEaRidaNQxdpYRS2oUFsEXYvtxp0L9+5FdC8o2pY8nkmaNqG4ePnOZXjO+57vjKhUJqhWq5yanGB8fJyxcpmZyQqXzk5TvbXG6FsYW/1Nee0v5dU/jTpmjqWOyflRc/5mm5HVTUZXfiH8/gDRaAy/z4ewWLFZFdKZDIV0BP3MXcQSiPltxH3+r3tt41A4gsXahcOpo2k6Q0NFSsMjJHwq2sxNLMtgXdhEWayj1OqNKh52ytK+ZxhZNN0lgS7cmkoyHsUXDOHpFhI4h3guT32whWiAJLwGh1aaKkilXoBNrpl7YlEql8uTDAexKDZ6dR2fy0kkFifh1/Cek5GfyY8WWkDTCRiv6mSl0i9Bf2I6bAMOHz7CUKlEKpXkQCpByKMRlA5TAQ11anafQzNaSK55nkLPUh31sVnbgANGP/FohICnl7DbyaCRJhTw4xAC+8lriGUTuLkLNCGvv2zx8Vudja/w6UedO5/NFDvAWMiHX+/BZVfQe2xk+oIU+1NkPQq+03P7ItsewYUPcHkDzr+vc3Edjr9rc1gsFkj2hXGrXbgcXSQScYysQS7owDl9Yy+y2dHF5thyZR1x+zvCbMZ8vflcWvdYyB3EiIUbLt0OG1EJTOULqDKytTK7F7kFNJ/J/E8U8ynVmnfa0ZRSfoCIW8Wr2fFIl25dJZ/PE7YLLCeudgJb0Bq7cNEOMzUoHfolLKB3E+p1EPG6yMg/xfAqOKeu70TudNgBb9Ud/QNovwJ4rzBaFgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"loginradius-consent-page.png\"\n        title=\"loginradius-consent-page.png\"\n        src=\"/static/2c30cb2b6ecd675ee7f6adecae33022c/e5715/loginradius-consent-page.png\"\n        srcset=\"/static/2c30cb2b6ecd675ee7f6adecae33022c/a6d36/loginradius-consent-page.png 650w,\n/static/2c30cb2b6ecd675ee7f6adecae33022c/e5715/loginradius-consent-page.png 768w,\n/static/2c30cb2b6ecd675ee7f6adecae33022c/0bd07/loginradius-consent-page.png 2898w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h3 id=\"redirect-to-protected-index-page\" style=\"position:relative;\"><a href=\"#redirect-to-protected-index-page\" aria-label=\"redirect to protected index page permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Redirect to Protected Index Page</h3>\n<p>On successful login from the above step, you will be redirected to the <code>protectedindex.scala.html</code> page.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 27.53846153846154%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAABYlAAAWJQFJUiTwAAAArklEQVQY062QfQuDIBDG/f5fr3ctwhq0P4KVrazcfKYHQg3GGEz48Tzn6Z0eq+saXXfFPE1Y1Ih5HEh3vcDuG57bkRUPp+ausLlzel3RqxnDrcekFEZ3j+lFwxiDfy0muIAQAlmWEUVRgHOOPM/JH5FS4tK2pE3TEFIGlWhdjkVRhDiOkSQJEbwv7jVN09N+WZbUsKoq+HH5OOCLMmvt6cnH2Pv3/Ncv/zqj0OQTL9GMyioWc8KWAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"loginradius-protected-index-page.png\"\n        title=\"loginradius-protected-index-page.png\"\n        src=\"/static/d83ff98f9f5a31ea8e23d98a8cc079e4/e5715/loginradius-protected-index-page.png\"\n        srcset=\"/static/d83ff98f9f5a31ea8e23d98a8cc079e4/a6d36/loginradius-protected-index-page.png 650w,\n/static/d83ff98f9f5a31ea8e23d98a8cc079e4/e5715/loginradius-protected-index-page.png 768w,\n/static/d83ff98f9f5a31ea8e23d98a8cc079e4/8c565/loginradius-protected-index-page.png 3346w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h3 id=\"logout-action\" style=\"position:relative;\"><a href=\"#logout-action\" aria-label=\"logout action permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Logout Action</h3>\n<p><a href=\"https://github.com/pac4j/play-pac4j\">play-pac4j</a> provides out of the box <code>LogoutController</code> which can be used to handle logout flows. It has <code>logout</code> functionality which has the logout logic implementation to clear the session. Below is the sample <code>logout</code> functionality from <code>org.pac4j.play.LogoutController</code> play-pac4j module.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"12\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">CompletionStage</span><span class=\"mtk1\">&lt;Result&gt; </span><span class=\"mtk11\">logout</span><span class=\"mtk1\">(</span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Http</span><span class=\"mtk1\">.</span><span class=\"mtk12\">Request</span><span class=\"mtk1\"> request) {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">HttpActionAdapter</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bestAdapter</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">FindBest</span><span class=\"mtk1\">.</span><span class=\"mtk11\">httpActionAdapter</span><span class=\"mtk1\">(</span><span class=\"mtk4\">null</span><span class=\"mtk1\">, config, </span><span class=\"mtk12\">PlayHttpActionAdapter</span><span class=\"mtk1\">.</span><span class=\"mtk12\">INSTANCE</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">LogoutLogic</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bestLogic</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">FindBest</span><span class=\"mtk1\">.</span><span class=\"mtk11\">logoutLogic</span><span class=\"mtk1\">(logoutLogic, config, </span><span class=\"mtk12\">DefaultLogoutLogic</span><span class=\"mtk1\">.</span><span class=\"mtk12\">INSTANCE</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">WebContext</span><span class=\"mtk1\"> </span><span class=\"mtk12\">context</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">FindBest</span><span class=\"mtk1\">.</span><span class=\"mtk11\">webContextFactory</span><span class=\"mtk1\">(</span><span class=\"mtk4\">null</span><span class=\"mtk1\">, config, </span><span class=\"mtk12\">PlayContextFactory</span><span class=\"mtk1\">.</span><span class=\"mtk12\">INSTANCE</span><span class=\"mtk1\">).</span><span class=\"mtk11\">newContext</span><span class=\"mtk1\">(request);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">CompletableFuture</span><span class=\"mtk1\">.</span><span class=\"mtk11\">supplyAsync</span><span class=\"mtk1\">(() </span><span class=\"mtk4\">-&gt;</span><span class=\"mtk1\"> (Result) </span><span class=\"mtk12\">bestLogic</span><span class=\"mtk1\">.</span><span class=\"mtk11\">perform</span><span class=\"mtk1\">(context, sessionStore, config, bestAdapter, </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">defaultUrl</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">logoutUrlPattern</span><span class=\"mtk1\">, </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">localLogout</span><span class=\"mtk1\">, </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">destroySession</span><span class=\"mtk1\">, </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">centralLogout</span><span class=\"mtk1\">), </span><span class=\"mtk12\">ec</span><span class=\"mtk1\">.</span><span class=\"mtk11\">current</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span></code></pre>\n<p>So to use this LogoutController, we just need to initialize it and define logout route for the same in our <code>routes</code>. We already initialized LoginController in <code>SecurityModule.java</code>.</p>\n<h4 id=\"a-initialize-logoutcontroller\" style=\"position:relative;\"><a href=\"#a-initialize-logoutcontroller\" aria-label=\"a initialize logoutcontroller permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>a. Initialize LogoutController</h4>\n<ul>\n<li>You can configure default url which application needs to redirect after <code>logout</code> action.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"13\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk3\">// logout</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">LogoutController</span><span class=\"mtk1\"> </span><span class=\"mtk12\">logoutController</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">LogoutController</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">logoutController</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setDefaultUrl</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/?defaulturlafterlogout&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">bind</span><span class=\"mtk1\">(</span><span class=\"mtk12\">LogoutController</span><span class=\"mtk1\">.</span><span class=\"mtk12\">class</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toInstance</span><span class=\"mtk1\">(logoutController);</span></span></code></pre>\n<h4 id=\"b-define-route-for-logoutcontroller\" style=\"position:relative;\"><a href=\"#b-define-route-for-logoutcontroller\" aria-label=\"b define route for logoutcontroller permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>b. Define Route for LogoutController</h4>\n<ul>\n<li>We already configured <code>/logout</code> Route using <code>LogoutController</code> in <code>conf/routes</code>.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"scala\" data-index=\"14\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">GET     /logout                     @org.pac4j.play.LogoutController.logout(request: Request)</span></code></pre>\n<p>On Clicking <code>logout</code> in our application, the session will be cleared and you will be redirected to the Home page based on our configuration. </p>\n<h2 id=\"source-code\" style=\"position:relative;\"><a href=\"#source-code\" aria-label=\"source code permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Source Code</h2>\n<p>You can see the full source code for the application developed in this tutorial on <a href=\"https://github.com/vishnuchilamakuru/loginradius-play-oidc-example\">GitHub</a>.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk17 { color: #808080; }\n</style>","frontmatter":{"date":"June 25, 2021","updated_date":null,"title":"Add Authentication to Play Framework With OIDC and LoginRadius","tags":["OIDC","Java","pac4j","Play Framework","Authentication"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/7fda86ee912dfb6374d4838c3062813c/ee604/pac4j-authentication.png","srcSet":"/static/7fda86ee912dfb6374d4838c3062813c/69585/pac4j-authentication.png 200w,\n/static/7fda86ee912dfb6374d4838c3062813c/497c6/pac4j-authentication.png 400w,\n/static/7fda86ee912dfb6374d4838c3062813c/ee604/pac4j-authentication.png 800w,\n/static/7fda86ee912dfb6374d4838c3062813c/db955/pac4j-authentication.png 900w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Vishnu Chilamakuru","github":"vishnuchilamakuru","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/rest-api-cucumber-blog/"},"html":"<h2 id=\"what-is-rest\" style=\"position:relative;\"><a href=\"#what-is-rest\" aria-label=\"what is rest permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Rest?</h2>\n<p>Representational State Transfer in short-form as <strong>REST</strong> defines a set of constraints for creating Web Services.\nRest API is the most-used web service technology nowadays, and it's an almost meaningless description. A REST API is a way to communicate for two computer systems over HTTP, which is similar to web browsers and servers.</p>\n<h2 id=\"what-is-bdd\" style=\"position:relative;\"><a href=\"#what-is-bdd\" aria-label=\"what is bdd permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is BDD?</h2>\n<p>BDD stands for <strong>Behavior Driven Development</strong> (BDD). Nowadays, many Organizations, to get a better advantage of testing, are taking a step forward.  </p>\n<ul>\n<li>BDD allows us to create test scripts from both the developer’s and the customer’s perspective.</li>\n<li>BDD uses human-readable descriptions of software user requirements as the basis for software tests</li>\n</ul>\n<h2 id=\"what-is-cucumber\" style=\"position:relative;\"><a href=\"#what-is-cucumber\" aria-label=\"what is cucumber permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Cucumber?</h2>\n<p>A cucumber is an approach that supports BDD. It allows you to write tests that anyone can understand, irrespective of their technical knowledge. In BDD, users (business analysts, product owners, developers, etc..). We need to first write scenarios or acceptance tests that describe the system's behavior from the customer's point of view for review and sign-off by the product owners before developers start actual development.</p>\n<h2 id=\"what-are-the-prerequisites-to-test-rest-api-using-cucumber\" style=\"position:relative;\"><a href=\"#what-are-the-prerequisites-to-test-rest-api-using-cucumber\" aria-label=\"what are the prerequisites to test rest api using cucumber permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What are the Prerequisites to Test Rest API using Cucumber?</h2>\n<ul>\n<li>Java</li>\n<li>Editor (Eclipse, IntelliJ, etc..)</li>\n<li>Maven</li>\n</ul>\n<h3 id=\"steps-to-install-java\" style=\"position:relative;\"><a href=\"#steps-to-install-java\" aria-label=\"steps to install java permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Steps to Install Java</h3>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">http://www.oracle.com/technetwork/java/javase/downloads/index.html  </span></code></pre>\n<p>Download JDK from the above link and install it\nSet the Environment Variable on System Properties </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">Right Click on My PC -&gt; Properties -&gt; Advanced System Settings -&gt; Environment Variables -&gt; Create New -&gt; provide path of JDK</span></code></pre>\n<h3 id=\"steps-to-install-eclipse\" style=\"position:relative;\"><a href=\"#steps-to-install-eclipse\" aria-label=\"steps to install eclipse permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Steps to Install Eclipse</h3>\n<ul>\n<li>Make Sure Java is installed on your PC.</li>\n<li>Use the below link to download Eclipse :\n<a href=\"https://eclipse.org/downloads\">Eclipse Download</a></li>\n<li>Install Eclipse on your PC </li>\n</ul>\n<p><strong>Steps to Install Maven</strong></p>\n<ul>\n<li>Use the below link to download Maven :\n<a href=\"https://maven.apache.org/download.cgi\">Maven Download</a></li>\n<li>Set the environment variable.</li>\n</ul>\n<h3 id=\"configuring-cucumber-with-maven\" style=\"position:relative;\"><a href=\"#configuring-cucumber-with-maven\" aria-label=\"configuring cucumber with maven permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Configuring Cucumber with Maven</h3>\n<ul>\n<li>\n<p>Create a Maven Project. Use below navigation.</p>\n<p><code>Open Eclipse -> File -> New -> Maven Project</code>\n</p>\n</li>\n<li>\n<p>Provide Group Id and Artifact Id and click on finish. </p>\n<p><strong>Group Id:</strong> This element indicates the organization's unique identifier or group that created the project. The groupId is one of the key identifiers of a project and is typically based on your organization's fully qualified domain name. For example, <code>com.loginradius</code>  is the designated groupId for all Maven plugins.</p>\n<p><strong>Artifact Id:</strong>  it points to the unique base name of the primary artifact generated by this project. The main or primary artifact for a project is typically a JAR file. Secondary artifacts like source bundles also use the artifactId as part of their final name.</p>\n</li>\n<li>\n<p>Open pom.xml file to add necessary dependencies </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;dependency&gt;</span>\n<span class=\"grvsc-line\">\t&lt;groupId&gt;io.cucumber&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">\t&lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">\t&lt;version&gt;6.6.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">&lt;/dependency&gt;</span>\n<span class=\"grvsc-line\">&lt;dependency&gt;</span>\n<span class=\"grvsc-line\">\t&lt;groupId&gt;io.cucumber&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">\t&lt;artifactId&gt;cucumber-testng&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">\t&lt;version&gt;6.6.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">&lt;/dependency&gt;</span>\n<span class=\"grvsc-line\">&lt;dependency&gt;</span>\n<span class=\"grvsc-line\">\t&lt;groupId&gt;io.rest-assured&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">\t&lt;artifactId&gt;rest-assured&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">\t&lt;version&gt;4.3.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">\t&lt;scope&gt;test&lt;/scope&gt;</span>\n<span class=\"grvsc-line\">&lt;/dependency&gt;</span>\n<span class=\"grvsc-line\">&lt;dependency&gt;</span>\n<span class=\"grvsc-line\">\t&lt;groupId&gt;org.testng&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">\t&lt;artifactId&gt;testng&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">\t&lt;version&gt;7.1.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">\t&lt;scope&gt;test&lt;/scope&gt;</span>\n<span class=\"grvsc-line\">&lt;/dependency&gt;</span></code></pre>\n</li>\n</ul>\n<p> Now we need three Important files.</p>\n<ul>\n<li>Feature file</li>\n<li>StepDefination file</li>\n<li>Runner file</li>\n</ul>\n<p> <strong>Feature File:</strong>  It's a entry point to the cucumber. We use Gherkins to write the feature file. This is the file where you will describe your descriptive language(Gherkin uses simple English). A feature file can contains a Scenario or List of Scenario. A sample Feature file is below</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">Feature: Login Functionality</span>\n<span class=\"grvsc-line\">@validLogin</span>\n<span class=\"grvsc-line\">Scenario: User Should Login With Valid Credentials </span>\n<span class=\"grvsc-line\">   Given Post Login API</span>\n<span class=\"grvsc-line\">   When Provide Valid Credential</span>\n<span class=\"grvsc-line\">   Then Status_code equals 200    </span>\n<span class=\"grvsc-line\">   And  response contains IsLogin equals &quot;true&quot;</span>\n<span class=\"grvsc-line\">@invalidLogin    </span>\n<span class=\"grvsc-line\">Scenario Outline: Email and Password Validation in Login API </span>\n<span class=\"grvsc-line\">   Given Post Login API</span>\n<span class=\"grvsc-line\">   When Provide different combinations to &quot;&lt;email&gt;&quot;&quot;&lt;password&gt;&quot;</span>\n<span class=\"grvsc-line\">   Then Status_code equals &lt;statuscode&gt;    </span>\n<span class=\"grvsc-line\">   And  response contains message equals &quot;&lt;message&gt;&quot;</span>\n<span class=\"grvsc-line\">   Examples:</span>\n<span class=\"grvsc-line\">   |email     \t\t|password    | statuscode |  message</span>\n<span class=\"grvsc-line\">   |          \t\t|            |   401      | Required email and password</span>\n<span class=\"grvsc-line\">   | abc\t  \t|            |   401      | Email format is incorrect</span>\n<span class=\"grvsc-line\">   | abc@mail7.io  \t|\t     |   401      | Required password</span>\n<span class=\"grvsc-line\">   | abc@mail7.io   \t| password   |   401      | Email and Password combination Incorrect</span></code></pre>\n<p> Save the above code as login.feature </p>\n<ul>\n<li><strong>Feature:</strong> It indicates the name of the feature under the test.</li>\n<li><strong>Description:</strong> It indicates a meaningful description of the feature (Optional).</li>\n<li><strong>scenario:</strong> scenario indicates the steps and expected outcomes for a particular test case.</li>\n<li><strong>Scenario Outline:</strong> Single scenario can be executed for multiple data sets using scenario outlines. The data is provided by a tabular structure separated by (I I).</li>\n<li><strong>Given:</strong> Prerequisite before the test steps get executed.</li>\n<li><strong>When:</strong> Specific condition which should match to execute the next step.</li>\n<li><strong>Then:</strong> What should happen if the condition mentioned in WHEN is satisfied.</li>\n<li><strong>Examples:</strong> Its a tabular format input data to pass to scenario outline.</li>\n<li><strong>&#x3C;>:</strong> anything if you write between is variable. </li>\n</ul>\n<p><strong>StepDefinition:</strong>\nNow you have your feature file ready with test scenarios defined. However, our job is not done yet. Cucumber doesn't know when should execute which part of code. So StepDefinition acts as an intermediate to your runner and feature file. It stores the mapping between each step of the scenario in the Feature file. So when you run the scenario, it will scan the stepDefination file to check matched glue.</p>\n<p><strong>How to write step definition:</strong>\nWe have a chrome extension(Tidy Gherkin) to convert your feature into a step definition.<br>\nCopy your scenario from the feature file and paste it in Tidy Gherkin and click on Java Steps; copy the Java Steps.\nCreate a new file name a StepDefinition.java and paste the Java Steps</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">package</span><span class=\"mtk1\"> com.loginradius.login</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk14\">import</span><span class=\"mtk1\"> cucumber.api.java.en.</span><span class=\"mtk14\">G</span><span class=\"mtk1\">iven;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> cucumber.api.java.en.When;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> cucumber.api.java.en.Then;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> cucumber.api.java.en.And;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> cucumber.api.junit.Cucumber;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> org.junit.runner.RunWith;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> </span><span class=\"mtk4\">static</span><span class=\"mtk1\"> io.restassured.RestAssured.given;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> </span><span class=\"mtk4\">static</span><span class=\"mtk1\"> org.testng.Assert.assertTrue;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> io.restassured.http.ContentType;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> io.restassured.response.Response;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> io.restassured.specification.RequestSpecification;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> io.restassured.RestAssured;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk4\">class</span><span class=\"mtk1\"> </span><span class=\"mtk10\">StepDefinition</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk4\">private</span><span class=\"mtk1\">  </span><span class=\"mtk4\">static</span><span class=\"mtk1\">  </span><span class=\"mtk4\">final</span><span class=\"mtk1\">  </span><span class=\"mtk10\">String</span><span class=\"mtk1\">  </span><span class=\"mtk12\">BASE_URL</span><span class=\"mtk1\">  =  </span><span class=\"mtk8\">&quot;https://www.loginradius.com&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">email</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;abcxyz@mail7.io;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">\tString password = &quot;</span><span class=\"mtk1\">password</span><span class=\"mtk8\">&quot;;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">\tRequestSpecification request;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">\tprivate  static  Response response;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">\tprivate  static  String  jsonString;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    @Given(&quot;</span><span class=\"mtk10\">Post</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Login</span><span class=\"mtk1\"> API</span><span class=\"mtk8\">&quot;)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    public void post_login_api() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">\t    RestAssured.baseURI  =  BASE_URL;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">\t\trequest  =  RestAssured.given();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">\t\trequest.header(&quot;</span><span class=\"mtk1\">Content-Type</span><span class=\"mtk8\">&quot;,  &quot;</span><span class=\"mtk1\">application/json</span><span class=\"mtk8\">&quot;);    </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">   @When(&quot;</span><span class=\"mtk10\">Provide</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Valid</span><span class=\"mtk1\"> Credential</span><span class=\"mtk8\">&quot;)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">    public void provide_valid_credential() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk8\">      response  =  request.body(&quot;</span><span class=\"mtk1\">{ \\</span><span class=\"mtk8\">&quot;userName</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">:</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">&quot;</span><span class=\"mtk1\">  +  email  +  </span><span class=\"mtk8\">&quot;</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">, </span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">password</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">:</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">&quot;</span><span class=\"mtk1\">  +  password  +  </span><span class=\"mtk8\">&quot;</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">}&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t\t\t\t\t  .</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/user/login&quot;</span><span class=\"mtk1\">);\t</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">   @</span><span class=\"mtk10\">Then</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Status_code equals {int}&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">void</span><span class=\"mtk1\"> </span><span class=\"mtk11\">statuscode_equals_</span><span class=\"mtk1\">(</span><span class=\"mtk10\">int</span><span class=\"mtk1\"> agr) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t    </span><span class=\"mtk12\">Assert</span><span class=\"mtk1\">.</span><span class=\"mtk11\">assertEquals</span><span class=\"mtk1\">(arg, </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getStatusCode</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t@</span><span class=\"mtk10\">And</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;response contains IsPosted equals {string}&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">void</span><span class=\"mtk1\"> </span><span class=\"mtk11\">response_contains_IsPosted_equals_</span><span class=\"mtk1\">(</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> message) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t    </span><span class=\"mtk12\">Assert</span><span class=\"mtk1\">.</span><span class=\"mtk11\">assertEquals</span><span class=\"mtk1\">(message, </span><span class=\"mtk11\">getJsonPath</span><span class=\"mtk1\">(response, </span><span class=\"mtk8\">&quot;IsPosted&quot;</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }\t</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">   @</span><span class=\"mtk10\">And</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;response contains message equals {string}&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">void</span><span class=\"mtk1\"> </span><span class=\"mtk11\">response_contains_equals_</span><span class=\"mtk1\">(</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> message) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t    </span><span class=\"mtk12\">Assert</span><span class=\"mtk1\">.</span><span class=\"mtk11\">assertEquals</span><span class=\"mtk1\">(message, </span><span class=\"mtk11\">getJsonPath</span><span class=\"mtk1\">(response, </span><span class=\"mtk8\">&quot;message&quot;</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t@</span><span class=\"mtk10\">When</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Provide different combinations to {string}, {string}&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">void</span><span class=\"mtk1\"> </span><span class=\"mtk11\">provide_different_combinations_to_somethingsomething</span><span class=\"mtk1\">(</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> email, </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> password){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t    response = </span><span class=\"mtk12\">request</span><span class=\"mtk1\">.</span><span class=\"mtk11\">body</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;{ </span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">userName</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">:</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">&quot;</span><span class=\"mtk1\"> + email + </span><span class=\"mtk8\">&quot;</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">, </span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">password</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">:</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">&quot;</span><span class=\"mtk1\"> + password + </span><span class=\"mtk8\">&quot;</span><span class=\"mtk6\">\\&quot;</span><span class=\"mtk8\">}&quot;</span><span class=\"mtk1\">) .</span><span class=\"mtk11\">post</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;/user/login&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk11\">getJsonPath</span><span class=\"mtk1\">(</span><span class=\"mtk10\">Response</span><span class=\"mtk1\"> response, </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> key) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">resp</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">response</span><span class=\"mtk1\">.</span><span class=\"mtk11\">asString</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk10\">JsonPath</span><span class=\"mtk1\"> </span><span class=\"mtk12\">js</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">JsonPath</span><span class=\"mtk1\">(resp);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t</span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">js</span><span class=\"mtk1\">.</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(key).</span><span class=\"mtk11\">toString</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Now we have Our Feature file and StepDefinition Ready, we need a runner file to run our Test Scenario's</p>\n<p><strong>Runner File:</strong>\nA runner will help us to run the feature file and acts as an interlink between the feature file and StepDefinition Class\nBelow is the code which will help you to run the tests</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">package</span><span class=\"mtk1\"> runner;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">import</span><span class=\"mtk1\"> io.cucumber.testng.CucumberOptions;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">@</span><span class=\"mtk10\">CucumberOptions</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\tfeatures= {</span><span class=\"mtk8\">&quot;feature_files/login.feature&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        glue= {</span><span class=\"mtk8\">&quot;step_definations/StepDefinitation.java&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        tags= </span><span class=\"mtk8\">&quot;@validLogin&quot;</span><span class=\"mtk1\">,    </span><span class=\"mtk3\">// based on tags scenarios will run</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        monochrome=</span><span class=\"mtk4\">true</span><span class=\"mtk1\">, dryRun=</span><span class=\"mtk4\">false</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">\t\t)\t</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">public</span><span class=\"mtk1\">  </span><span class=\"mtk4\">class</span><span class=\"mtk1\">  </span><span class=\"mtk10\">TestRunner</span><span class=\"mtk1\">  {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Now We have Feature, StepDefinition, and runner files ready, We can run the runner file to see the results.</p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>Cucumber is very useful in understanding the overall testing process without having coding knowledge. Since it uses simple English to write the feature file and makes developer, QA and other stakeholders on same page before starting the actual development.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk14 { color: #F44747; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk6 { color: #D7BA7D; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n</style>","frontmatter":{"date":"November 05, 2020","updated_date":null,"title":"Automating Rest API's using Cucumber and Java","tags":["Automation","Cucumber","Rest API","Java"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/6185494b9a177d30a2dc78ccaca79e14/ee604/cucumber_rest_assured.png","srcSet":"/static/6185494b9a177d30a2dc78ccaca79e14/69585/cucumber_rest_assured.png 200w,\n/static/6185494b9a177d30a2dc78ccaca79e14/497c6/cucumber_rest_assured.png 400w,\n/static/6185494b9a177d30a2dc78ccaca79e14/ee604/cucumber_rest_assured.png 800w,\n/static/6185494b9a177d30a2dc78ccaca79e14/f3583/cucumber_rest_assured.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Surendranath Reddy Birudala","github":"reddysuren","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/apache-beam/"},"html":"<p>We'll talk about Apache Beam in this guide and discuss its fundamental concepts. We will begin by showing the features and advantages of using Apache Beam, and then we will cover basic concepts and terminologies.</p>\n<p>Ever since the concept of big data got introduced to the programming world, a lot of different technologies, frameworks have emerged. The processing of data can be categorized into two different paradigms. One is Batch Processing, and the other is Stream Processing. </p>\n<p>Different technologies came into existence for different paradigms, solving various big data world problems, for, e.g., Apache Spark, Apache Flink, Apache Storm, etc. </p>\n<p>As a developer or a business, it's always challenging to maintain different tech stacks and technologies. Hence, Apache Beam to the rescue!</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 49.84615384615385%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAACHklEQVQoz2WSW2/TQBCF/VeReOYnIPHEMxL0pVJBkaCiSCBVqSiI0obSplUhbZM0F5qEksS5NY4vseO1vfbHOqagiJFWe5kzc3b3HC12Z4jrE8J+jWjcJhw2SYAkSUjimDTSvZSSWO3TcxknyxnSvJ9hjHcE+w/Q4sAjGDQJVbPotktk9FH4ZZM0HNNgYU2zolj+Icmypl7j+v0XWnuX9PKb6M8fobES0b+l6xJPhpTXcuiFwgrqvCsJUrRep5IrU3nVoLrZovL6Ek0sbBoXH7gq7VIsPuG6U+H8/Ai9VsQ6/kxUvVg2kbNb/FIR7BkPt4Y825/ysdKi16sj5z/xzRae2USzzTGlozd8/7pFu12nPxtyXN/jpLWP4Y1xwwRbqJuHAcbGU+Zrj7k6LbN1afLisE9v6jAY+1Tb4ZJYsy2T8WjAwvNWnlU92+bsIMdxYRPPzz5ehpJBp4lo7qgvaTDs99jJ53m7vceNnmG0KIoUuSCKQiVGpurCc9G7LSajXwT+/C+JUOnclUnvpkLn9CW1coF8YRdh1RRBE0PvpqLc6XlnhQQhFpizKYEQGcHCZTLWcWyTSEHmc5OjTxsc7K5zcbiO+Haf+ek9+qX/VF6NO6ogCLDMmWqsLCZ8jOkto5GOaVkkUihRfiCdhrJkT/nQmyBdHakEkN6I2DeyISziwFnOaRGhkxoRGQl8Z4zn2oSewoULktAniQKFn/MbmpDqVNye7XEAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Timeline of Big Data Frameworks\"\n        title=\"Timeline of Big Data Frameworks\"\n        src=\"/static/1e7f65aaa920379cd8b429236ecf5cb7/e5715/timeline-bigdata-frameworks.png\"\n        srcset=\"/static/1e7f65aaa920379cd8b429236ecf5cb7/a6d36/timeline-bigdata-frameworks.png 650w,\n/static/1e7f65aaa920379cd8b429236ecf5cb7/e5715/timeline-bigdata-frameworks.png 768w,\n/static/1e7f65aaa920379cd8b429236ecf5cb7/07a9c/timeline-bigdata-frameworks.png 1440w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h2 id=\"what-is-apache-beam\" style=\"position:relative;\"><a href=\"#what-is-apache-beam\" aria-label=\"what is apache beam permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Apache Beam?</h2>\n<p>Apache Beam is an open source, centralised model for describing parallel-processing pipelines for both batch and streaming data. The programming model of the Apache Beam simplifies large-scale data processing dynamics. </p>\n<p>The Apache Beam model offers helpful abstractions that insulate you from distributed processing information at low levels, such as managing individual staff, exchanging databases, and other activities. These low-level information are handled entirely by Dataflow. </p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 76.46153846153847%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEHElEQVQ4y02UC0xTVxjHv0IpYKaQyEOyMWhLawx0Mpgxm2yyKO/yKM4lsoTNMEbcSwLUIkUID43bkBCJzrBBykBgmDhlXQimKE8FlrmFxwUKLVVMnDQUS3m0vbf322lBspP88v9yT/LL951zcoHRy4BdkIFVmw64kQWIZ+BeyxEgi0PwJngSeASvbTzXS4WALRLAzkjArijAhnBYuyCEhYJQAAcRoiHTbY1K9UD8nIv4LcnT7rmn+N6iYF5A9H6vgJMf+vglv7s7MJzv+fr+N3n+eFHsjn2HuPgohov6WC7eedvjRbHArT/nDQBGJyNkyIl4bnM2fcQylTrm0Mmm2ScfNeOQpI4dCJ9c7TnwiPAQSc0ORdRhRViz5YJwerVUMGYqEYxslAlnsVpUgRdFWx0S4Y+sXoYbM+n4ciINWX0GMoaTE9YHkgH7gwg0qg+4cNbWfkk/VorHzUo+mpRh+FwhQDIuEmE7XhJvCQnBtC7jMD7LjFrVnZcaJ/LicT6Sb78NIXQXSKxDH8TYCLSaK7H/ASH4BfCt11MSN1XZaVgjjsLL4sNMhYi/WS7cEQIznwz4LA9wEGDhBYbNGejITUR/RNylW8FQnQVDnfUa+TZvwahxxGC88hZgLbmcSwJgKkVgLQ8jQtcZyjiMUeVBI8LG+kosso4VB8usOMzTL9FqNhLRMrLMMqLDyDqYZQLtoO13T5CXgM2pbsy1BHe2SsTBKhG4Fo/HA5vN5ma322HNYo5jHUSBDqR73sf1x2o0/LuMBr0OtVotmkwm1rlL0/RDEuBkaWkJRkdHt2RUqwambmo4RsrAdW5azOYklmVdQjvVjfTSItoZFu02G9qsNmRoMgfrEv7pfKt3vq51uyo96ybfl8Ap8o97JewFqukeTHQPw+jy/K6Zudk4al6bNm20yaaeLn42SU3KJ2emz80+0Z3WLuozSMq0Bl10dcQp+CHpS8jfEwvyoAQo/J/Qj2rRCMd/6zv4uKsvpruxU3C3sF6slteE93yviqkXfuqTCfDar/k1MaqsUsnPKYXiX5S1op/OVB29Iv0msmDvMaE8KDGg0P/4jrCWJE619TJU+33854Y6f0DR9HxQ2WwfKFHhcFnLrbbEcw0dqSXYIT1vu5WqNNcczD5bFJSwVhwixaLAeCQjN5KErXFbNZUk16ZaNfNUW+/i39d/z+tXNFGDJaqnwyXNppHymw0diYrvOqVKU0dysaEzVblQE5mdV+B3XFsUEK8nMjOR1ZHc6dCLpC9JH9Kh79jV255/lbXvbsyp2Jt79EToJ++lBCaFvOOfKToiUBz6OECdWbnnsiTLs3BfvI8iONmHyHyJzHurw9bebTQuqLb7sNg6BM051bC9vF/9ZbaTU3/sK7gRnQsF5MycXRUR5ETmFP4HPQyC2KrLXHkAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Beam-Model\"\n        title=\"Beam-Model\"\n        src=\"/static/bcda8196d6c879a95ccdd397242e01fb/e5715/beam_architecture.png\"\n        srcset=\"/static/bcda8196d6c879a95ccdd397242e01fb/a6d36/beam_architecture.png 650w,\n/static/bcda8196d6c879a95ccdd397242e01fb/e5715/beam_architecture.png 768w,\n/static/bcda8196d6c879a95ccdd397242e01fb/1cfc2/beam_architecture.png 900w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h2 id=\"features-of-apache-beam\" style=\"position:relative;\"><a href=\"#features-of-apache-beam\" aria-label=\"features of apache beam permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Features of Apache Beam</h2>\n<p>The unique features of Apache  beam are as follows:</p>\n<ol>\n<li>Unified - Use a single programming model for both batch and streaming use cases.</li>\n<li>Portable - Execute pipelines in multiple execution environments. Here, execution environments mean different runners. Ex. Spark Runner, Dataflow Runner, etc</li>\n<li>Extensible - Write custom SDKs, IO connectors, and transformation libraries.</li>\n</ol>\n<h2 id=\"apache-beam-sdks-and-runners\" style=\"position:relative;\"><a href=\"#apache-beam-sdks-and-runners\" aria-label=\"apache beam sdks and runners permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Apache Beam SDKs and Runners</h2>\n<p>As of today, there are 3 Apache beam programming SDKs</p>\n<ol>\n<li>Java</li>\n<li>Python</li>\n<li>Golang</li>\n</ol>\n<p>Beam Runners translate the beam pipeline to the API compatible backend processing of your choice. Beam currently supports runners that work with the following backends.</p>\n<ol>\n<li>Apache Spark</li>\n<li>Apache Flink</li>\n<li>Apache Samza</li>\n<li>Google Cloud Dataflow</li>\n<li>Hazelcast Jet</li>\n<li>Twister2</li>\n</ol>\n<p>Direct Runner to run on the host machine, which is used for testing purposes.</p>\n<h2 id=\"basic-concepts-in-apache-beam\" style=\"position:relative;\"><a href=\"#basic-concepts-in-apache-beam\" aria-label=\"basic concepts in apache beam permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Basic Concepts in Apache Beam</h2>\n<p>Apache Beam has three main abstractions. They are</p>\n<ol>\n<li>Pipeline</li>\n<li>PCollection</li>\n<li>PTransform</li>\n</ol>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 13.999999999999998%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAYAAACTWi8uAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/klEQVQI1wHzAAz/APXx65U1ZahDOWmr/0Fvr/osX6b/Y4e5ef///z8mWaBRNGWq/zdnq/ktYKf/dJO/bv///zsfVJ5bPWut/0BurvkvYaf/SXSwPvbz7Z3k5ebHAOPg28VLd7VKOmqu/0t2tP8zZKr/cJC8k///73coV5paOGir/0NxsP8xY6n/g57Cjf//73EfUphjPmyu/0l0sv82Zqr/Y4e6TNrX09PS0tP/AHlsWRhcc5MrJU6HZyNSlFUwYqlUDEeaFpWsywAuY60YK16mUyZapE0tX6ZUADWTD5OqygAxZa0cK16lVChcpU0vYadTCEacDf/v1wvf4eMUMeqAEPko5kUAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Beam-Pipeline\"\n        title=\"Beam-Pipeline\"\n        src=\"/static/439968fcb84e700e21b6475c5aa49214/e5715/pipeline-design.png\"\n        srcset=\"/static/439968fcb84e700e21b6475c5aa49214/a6d36/pipeline-design.png 650w,\n/static/439968fcb84e700e21b6475c5aa49214/e5715/pipeline-design.png 768w,\n/static/439968fcb84e700e21b6475c5aa49214/1132d/pipeline-design.png 1158w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h3 id=\"pipeline\" style=\"position:relative;\"><a href=\"#pipeline\" aria-label=\"pipeline permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Pipeline:</h3>\n<p>A pipeline is the first abstraction to be created. It holds the complete data processing job from start to finish, including reading data, manipulating data, and writing data to a sink. Every pipeline takes in options/parameters that indicate where and how to run. </p>\n<h3 id=\"pcollection\" style=\"position:relative;\"><a href=\"#pcollection\" aria-label=\"pcollection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>PCollection:</h3>\n<p>A pcollection is an abstraction of distributed data. A pcollection can be bounded, i.e., finite data, or unbounded, i.e., infinite data. The initial pcollection is created by reading data from the source. From then on, pcollections are the source and sink of every step in the pipeline.</p>\n<h3 id=\"transform\" style=\"position:relative;\"><a href=\"#transform\" aria-label=\"transform permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Transform:</h3>\n<p>A transform is a data processing operation. A transform is applied on one or more pcollections. Complex transforms have other transform nested within them. Every transform has a generic <code>apply</code> method where the logic of the transform sits in.</p>\n<h2 id=\"example-of-pipeline\" style=\"position:relative;\"><a href=\"#example-of-pipeline\" aria-label=\"example of pipeline permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example of Pipeline</h2>\n<p>Here, let's write a pipeline to output all the jsons where the name starts with a vowel.</p>\n<p>Let's take a sample input. Name the file as <code>input.json</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;abhi&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">12</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;virat&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">23</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;dhoni&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">45</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;rahul&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk7\">156</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Edmund&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Ojha&quot;</span><span class=\"mtk1\">}</span></span></code></pre>\n<p>The input should be a newline delimited JSON.</p>\n<p>Include the following dependencies in your <code>pom.xml</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;dependency&gt;</span>\n<span class=\"grvsc-line\">    &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">    &lt;artifactId&gt;beam-sdks-java-core&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">    &lt;version&gt;2.24.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">&lt;/dependency&gt;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">&lt;dependency&gt;</span>\n<span class=\"grvsc-line\">    &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">    &lt;artifactId&gt;beam-runners-direct-java&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">    &lt;version&gt;2.24.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">&lt;/dependency&gt;</span></code></pre>\n<p>Let's code the beam pipeline. Follow the steps</p>\n<ol>\n<li>\n<p>Create a pipeline.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">Pipeline</span><span class=\"mtk1\"> </span><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">Pipeline</span><span class=\"mtk1\">.</span><span class=\"mtk11\">create</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// OR </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Pipeline pipeLine = Pipeline.create(options);</span></span></code></pre>\n<p>Create a pipeline which binds all the pcollections and transforms. Optionally you can pass the PipelineOptions <code>options</code> if needed.</p>\n</li>\n<li>\n<p>Read the input file</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">PCollection</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">&gt; </span><span class=\"mtk12\">inputCollection</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Read My File&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">read</span><span class=\"mtk1\">().</span><span class=\"mtk11\">from</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;input.json&quot;</span><span class=\"mtk1\">));</span></span></code></pre>\n<p>Use the <code>TextIO</code> transform to read the input files. Every line is a different json record.</p>\n</li>\n<li>\n<p>Apply a transform to filter out the names starting from a vowel</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">PCollection</span><span class=\"mtk1\"> </span><span class=\"mtk12\">filteredCollection</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">inputCollection</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Filter names starting with vowels&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Filter</span><span class=\"mtk1\">.</span><span class=\"mtk11\">by</span><span class=\"mtk1\">(</span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">SerializableFunction</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">, </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\">&gt;() {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\"> </span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">input</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk10\">ObjectMapper</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ObjectMapper</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">try</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk10\">JsonNode</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\">.</span><span class=\"mtk11\">readTree</span><span class=\"mtk1\">(input);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\">.</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;name&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">textValue</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">vowels</span><span class=\"mtk1\">.</span><span class=\"mtk11\">contains</span><span class=\"mtk1\">(</span><span class=\"mtk12\">name</span><span class=\"mtk1\">.</span><span class=\"mtk11\">substring</span><span class=\"mtk1\">(</span><span class=\"mtk7\">0</span><span class=\"mtk1\">,</span><span class=\"mtk7\">1</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toLowerCase</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            } </span><span class=\"mtk15\">catch</span><span class=\"mtk1\"> (</span><span class=\"mtk10\">JsonProcessingException</span><span class=\"mtk1\"> </span><span class=\"mtk12\">e</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk11\">printStackTrace</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">false</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }))</span></span></code></pre>\n<p>The filter transform takes a SerializableFunction Object where the <code>apply</code> method is overridden. Every json-string record is converted to a JSON. The first character of the <code>name</code> is checked if it's a vowel. The transform is applied to each input JSON record. Based on the boolean value returned, the record is retained or discarded.</p>\n</li>\n<li>\n<p>Write the results to a file</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">inputCollection</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;write to file&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">write</span><span class=\"mtk1\">().</span><span class=\"mtk11\">to</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;result&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withSuffix</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.txt&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withoutSharding</span><span class=\"mtk1\">());</span></span></code></pre>\n<p>The results of the <code>Filter</code> transform are stored in a text file using the write method of the <code>TextIO</code> transform. As PCollections are distributed across machines, the results are written to multiple files/shards. To avoid this, we use <code>withoutSharding</code> where all the output is written to a single file.</p>\n</li>\n</ol>\n<p>Output:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Edmund&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Ojha&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;abhi&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">12</span><span class=\"mtk1\">}</span></span></code></pre>\n<hr>\n<p>Complete Code:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">Pipeline</span><span class=\"mtk1\"> </span><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">Pipeline</span><span class=\"mtk1\">.</span><span class=\"mtk11\">create</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Set</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">&gt; </span><span class=\"mtk12\">vowels</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">HashSet</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">&gt;(</span><span class=\"mtk12\">Arrays</span><span class=\"mtk1\">.</span><span class=\"mtk11\">asList</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;a&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;e&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;i&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;o&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;u&quot;</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Read My File&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">read</span><span class=\"mtk1\">().</span><span class=\"mtk11\">from</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;input.json&quot;</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        .</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Filter names starting with vowels&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Filter</span><span class=\"mtk1\">.</span><span class=\"mtk11\">by</span><span class=\"mtk1\">(</span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">SerializableFunction</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">, </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\">&gt;() {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\"> </span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">input</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk10\">ObjectMapper</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ObjectMapper</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">try</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk10\">JsonNode</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\">.</span><span class=\"mtk11\">readTree</span><span class=\"mtk1\">(input);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\">.</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;name&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">textValue</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">vowels</span><span class=\"mtk1\">.</span><span class=\"mtk11\">contains</span><span class=\"mtk1\">(</span><span class=\"mtk12\">name</span><span class=\"mtk1\">.</span><span class=\"mtk11\">substring</span><span class=\"mtk1\">(</span><span class=\"mtk7\">0</span><span class=\"mtk1\">,</span><span class=\"mtk7\">1</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toLowerCase</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                } </span><span class=\"mtk15\">catch</span><span class=\"mtk1\"> (</span><span class=\"mtk10\">JsonProcessingException</span><span class=\"mtk1\"> </span><span class=\"mtk12\">e</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk11\">printStackTrace</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">false</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        .</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;write to file&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">write</span><span class=\"mtk1\">().</span><span class=\"mtk11\">to</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;result&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withSuffix</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.txt&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withoutSharding</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\">.</span><span class=\"mtk11\">run</span><span class=\"mtk1\">().</span><span class=\"mtk11\">waitUntilFinish</span><span class=\"mtk1\">();</span></span></code></pre>\n<p>For more advanced concepts, refer to the official site - beam.apache.org</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n</style>","frontmatter":{"date":"October 16, 2020","updated_date":null,"title":"Apache Beam: A Basic Guide","tags":["Engineering","Big Data","Streaming","Apache Beam","Java"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/17c96c6367455f79bdb854c4608ebaba/ee604/main.png","srcSet":"/static/17c96c6367455f79bdb854c4608ebaba/69585/main.png 200w,\n/static/17c96c6367455f79bdb854c4608ebaba/497c6/main.png 400w,\n/static/17c96c6367455f79bdb854c4608ebaba/ee604/main.png 800w,\n/static/17c96c6367455f79bdb854c4608ebaba/f3583/main.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Abhilash K R","github":"Better-Boy","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/how-to-use-maven-dependency-in-eclipse/"},"html":"<p>Maven is a project build management software, it means it Let's you define your project dependencies, features, and behaviors. To do this, Maven downloads plugins and dependencies for various online repositories. People who want to share their libraries, develop using Maven and upload the binaries in a repository. In this article, we’ll discuss how to configure and use Maven dependency.</p>\n<p>Prerequisites:</p>\n<ul>\n<li>Eclipse IDE</li>\n<li>Active internet connection</li>\n</ul>\n<p><strong>Install the Maven support for Eclipse (m2e)</strong></p>\n<p>Most Eclipse downloads include the Maven tooling already. If it is missing in your installation, you can install it via the main update of your release via Help > Install New Software. The following listing contains the update site for the Neon release and an update site maintained by the m2e project.</p>\n<ul>\n<li>Neon update site:<br>\n<a href=\"http://download.eclipse.org/releases/neon\">Neon Update</a></li>\n<li>Update site provided by m2e project:<br>\n<a href=\"http://download.eclipse.org/technology/m2e/releases\">Eclipse Downloads</a></li>\n</ul>\n<p>For the usage of Maven for Java projects, you only need the m2e component. For Java web development you also want the m2e-wtp entry.</p>\n<p><strong>Download the Maven index</strong></p>\n<p>By default, the Maven tooling does not download the Maven index for the Eclipse IDE. Via the Maven index, you can search for dependencies, select them and add them to your pom file. To download the index, select Windows > Preferences > Maven and enable the <em>Download repository index updates on startup</em> option.</p>\n<p>After changing this setting, restart Eclipse. This triggers the download of the Maven index. You may want to remove this flag after restarting to avoid network traffic at every start of Eclipse.</p>\n<p><strong>Create Maven project</strong></p>\n<p>Create a new Maven project via File > New > Other… > Maven > Maven Project.</p>\n<p>On the first wizard page, you can select if you want to create a simple project.</p>\n<p>After creating the Maven project, a pom.xml is generated. You can find the file in Project Explorer. A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project. It contains default values for most projects.</p>\n<p>Now, you can add a dependency in pom.xml. For example, if you want to add LoginRadius for Java library/dependency, you can add as follows:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;dependencies&gt;</span>\n<span class=\"grvsc-line\">    &lt;dependency&gt;</span>\n<span class=\"grvsc-line\">        &lt;groupId&gt;com.loginradius.sdk&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">        &lt;artifactId&gt;java-sdk&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">        &lt;version&gt;11.0.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">    &lt;/dependency&gt;</span>\n<span class=\"grvsc-line\">    ......</span>\n<span class=\"grvsc-line\">&lt;/dependencies&gt;</span></code></pre>\n<p>You should now be able to quickly import any libraries that you want o use in your project via Maven.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"July 11, 2017","updated_date":null,"title":"Maven Dependency in Eclipse","tags":["Java","Maven","Eclipse"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/2d5127407846f33b1b7073695bd669d7/ee604/maven.png","srcSet":"/static/2d5127407846f33b1b7073695bd669d7/69585/maven.png 200w,\n/static/2d5127407846f33b1b7073695bd669d7/497c6/maven.png 400w,\n/static/2d5127407846f33b1b7073695bd669d7/ee604/maven.png 800w,\n/static/2d5127407846f33b1b7073695bd669d7/f3583/maven.png 1200w,\n/static/2d5127407846f33b1b7073695bd669d7/e4d72/maven.png 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Giriraj Yadav","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/html5-limitation-in-internet-explorer/"},"html":"<p>HTML 5 is the latest and greatest web technology, although it has some issues in some browsers which don’t have native support for the new HTML5 elements. If you want to support some of the older browsers which may still be in use such as IE8 and lower then you are going to have some trouble using HTML5.</p>\n<p>The problem with IE8 and lower versioned IE browsers is that they were created many years ago while HTML5 is new technology and HTML5 tags were newly invented so legacy browsers do not support them. Microsoft will not release any updates for these browsers because they have released new versions of the IE browser.</p>\n<p>As old IE browsers do not know about these tags then it can’t style them so you will find that in IE8 or lower your websites will be rendered without many styles.</p>\n<h4 id=\"how-to-use-html5-in-ie\" style=\"position:relative;\"><a href=\"#how-to-use-html5-in-ie\" aria-label=\"how to use html5 in ie permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How to use HTML5 in IE</h4>\n<p>If you want HTML5s new tags to be supported in IE then you need to add some javascript to create the elements:</p>\n<p>Example:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    document.createElement(&#39;header&#39;);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    document.createElement(&#39;article&#39;);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    document.createElement(&#39;aside&#39;);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    document.createElement(&#39;footer&#39;);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>This is not a very good way, you would need to remember all the tags that you have set and include them on every page of your website. If you add any new tags then you need to add these tags on every page of the website as well. Thankfully Remy Sharp provided a solution for this, Remy Sharp has created a Javascript file which he hosts with google code that will handle this for you.</p>\n<p>add the following at the top of your pages and it will include this code file on your website if the end user is using an IE browser lower than version 9.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--[</span><span class=\"mtk12\">if</span><span class=\"mtk1\"> </span><span class=\"mtk12\">lt</span><span class=\"mtk1\"> </span><span class=\"mtk12\">IE</span><span class=\"mtk1\"> </span><span class=\"mtk7\">9</span><span class=\"mtk1\">]&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk1\"> </span><span class=\"mtk12\">src</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;https://html5shim.googlecode.com/svn/trunk/html5.js&quot;</span><span class=\"mtk17\">&gt;&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">&lt;![</span><span class=\"mtk12\">endif</span><span class=\"mtk1\">]--&gt;</span></span></code></pre>\n<p>IE also does not support some of the most useful new HTML5 methods that are supported by modern browsers:Window.postMessage()</p>\n<p><strong>Window.postMessage</strong></p>\n<p>allows for sending data messages between two windows/frames across domains. Normally, scripts on different pages are allowed to access each other if and only if the pages that executed them are at the same locations with the same protocol (usually both http) and matching host names. The HTML5 postMessage function provides a great way to communicate securely and with high performance and reliability even cross-domain. Unfortunately, the HTML5 postMessage function does not work in IE</p>\n<p>Let’s take a look at how Window.postMessage works:</p>\n<h4 id=\"syntax\" style=\"position:relative;\"><a href=\"#syntax\" aria-label=\"syntax permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Syntax</h4>\n<p>The below signature is used for postMessage:</p>\n<p><strong>otherWindow.postMessage(message, targetOrigin);</strong></p>\n<p><strong>otherWindow</strong>\nA reference to another window; such a reference may be obtained, for example, using the contentWindow property of an iframe element, the object returned by window.open</p>\n<p><strong>message</strong>\nThis parameter is required for a message to be sent to the other window. The message is serialized using the structured clone algorithm. This means you can pass a broad variety of data objects safely to the destination window without having to serialize them yourself.</p>\n<p><strong>targetOrigin</strong>\nWhen the message is dispatched, the current location of the target document is checked. If it does not match the specified URI, then the message will not be dispatched. This parameter can be useful if you want to be sure of the location of the target document before dispatching the message and you can also specify a literal string “*”  (indicating no preference) or as a URI</p>\n<p>but always provide a specific targetOrigin, not *, if you know where the other window’s document should be located. If you do not set a specific location and use “*” then a malicious site can change the location of the window without your knowledge, and therefore it can intercept the data sent using the postMessage method.</p>\n<p><strong>Example for postMessage</strong></p>\n<p><strong>Sender</strong></p>\n<p>The first part of the process is setting up a “source”.  With the source, we will open a new window (or IFrame), send the new window message (in the our example, we’ll do so every 6 seconds, and create an event listener for any response we receive from the destination window.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">//create popup window</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">domain</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&#39;https://www.example.com&#39;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">myPopup</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">window</span><span class=\"mtk1\">.</span><span class=\"mtk11\">open</span><span class=\"mtk1\">(</span><span class=\"mtk12\">domain</span><span class=\"mtk1\"> + </span><span class=\"mtk8\">&#39;/postmessage.html&#39;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&#39;myWindow&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//periodical message sender</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">setInterval</span><span class=\"mtk1\">(</span><span class=\"mtk4\">function</span><span class=\"mtk1\">(){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">message</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&#39;Hello!  The time is: &#39;</span><span class=\"mtk1\"> + (</span><span class=\"mtk4\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Date</span><span class=\"mtk1\">().</span><span class=\"mtk11\">getTime</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">myPopup</span><span class=\"mtk1\">.</span><span class=\"mtk11\">postMessage</span><span class=\"mtk1\">(</span><span class=\"mtk12\">message</span><span class=\"mtk1\">,</span><span class=\"mtk12\">domain</span><span class=\"mtk1\">); </span><span class=\"mtk3\">//send the message and target URI</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">},</span><span class=\"mtk7\">6000</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//listen to back</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">window</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addEventListener</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;message&#39;</span><span class=\"mtk1\">,</span><span class=\"mtk4\">function</span><span class=\"mtk1\">(</span><span class=\"mtk12\">event</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">event</span><span class=\"mtk1\">.</span><span class=\"mtk12\">origin</span><span class=\"mtk1\"> !== </span><span class=\"mtk8\">&#39;http://scriptandstyle.com&#39;</span><span class=\"mtk1\">) </span><span class=\"mtk15\">return</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;received response:  &#39;</span><span class=\"mtk1\">,</span><span class=\"mtk12\">event</span><span class=\"mtk1\">.</span><span class=\"mtk12\">data</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">},</span><span class=\"mtk4\">false</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>I have used window.addEventListener which doesn’t work with Internet Explorer so use window.attachEvent</p>\n<p><strong>Receiver</strong></p>\n<p>In the destination window we should validate the message origin and if it is not valid then we will not send the message to the sender, otherwise we send a response back to the sender:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">window</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addEventListener</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;message&#39;</span><span class=\"mtk1\">,</span><span class=\"mtk4\">function</span><span class=\"mtk1\">(</span><span class=\"mtk12\">event</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">event</span><span class=\"mtk1\">.</span><span class=\"mtk12\">origin</span><span class=\"mtk1\"> !== </span><span class=\"mtk8\">&#39;https://lrblogs.wpengine.com) return</span><span class=\"mtk14\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">event</span><span class=\"mtk1\">.</span><span class=\"mtk12\">source</span><span class=\"mtk1\">.</span><span class=\"mtk11\">postMessage</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;message received:  &#39;</span><span class=\"mtk1\">,</span><span class=\"mtk12\">event</span><span class=\"mtk1\">.</span><span class=\"mtk12\">origin</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">},</span><span class=\"mtk4\">false</span><span class=\"mtk1\">);</span></span></code></pre>\n<p><strong>sessionStorage</strong></p>\n<p>sessionStorage stores data for one session only, this is used in a single transaction it stores the data only for one session and as you close the window the session would be lost and  the data is deleted when the browser is closed.</p>\n<p>HTML5 sessionStorage object are shared in different tabs in the same browser session if you change a sessionStorage attribute’s value in one tab, that change should be reflected within another tab but in IE8 this system will not work properly it does not share sessionStorage objects between frames on a page. This issue has since been fixed in IE11.</p>\n<p><strong>Example:</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">//save a value</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">sessionStorage</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setItem</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;website&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;https://www.example.com&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//retrieve item</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">website</span><span class=\"mtk1\">= </span><span class=\"mtk12\">sessionStorage</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getItem</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;website&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//remove the key</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">sessionStorage</span><span class=\"mtk1\">.</span><span class=\"mtk11\">removeItem</span><span class=\"mtk1\">(“</span><span class=\"mtk12\">website</span><span class=\"mtk1\">”);</span></span></code></pre>\n<p><strong>localStorage</strong></p>\n<p>The localStorage object stores the data like a persistent cookie, with no expiration date. The data will not be deleted when the browser is closed, and will be available when a user returns to the browser.</p>\n<p>IE also supports localStorage from IE8 but it does not support localStorage in IE7 and previous versions.</p>\n<p>localStorage Vs Cookies</p>\n<ol>\n<li>Cookies are small text files stored by browsers allowing for a max of 4KB while with localStorage we can store Mbs of localStorage data.</li>\n<li>Cookies are delivered with every request, which can slow down the delivery of your web pages.</li>\n</ol>\n<p><strong>Example</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk3\">//save a value</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">localStorage</span><span class=\"mtk1\">.</span><span class=\"mtk11\">setItem</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Domain&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;https://www.example.com&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//retrieve item</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">website</span><span class=\"mtk1\">= </span><span class=\"mtk12\">localStorage</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getItem</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;website&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">//remove the key</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">localStorage</span><span class=\"mtk1\">.</span><span class=\"mtk11\">removeItem</span><span class=\"mtk1\">(“</span><span class=\"mtk12\">website</span><span class=\"mtk1\">”);</span></span></code></pre>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk17 { color: #808080; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk14 { color: #F44747; }\n</style>","frontmatter":{"date":"June 30, 2015","updated_date":null,"title":"HTML5 Limitation in Internet Explorer","tags":["Java","Maven","Eclipse"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/56b8ac1b7f3b7dfdc03ce43aa1e62eaa/7d145/radio-check-buttons-css.png","srcSet":"/static/56b8ac1b7f3b7dfdc03ce43aa1e62eaa/69585/radio-check-buttons-css.png 200w,\n/static/56b8ac1b7f3b7dfdc03ce43aa1e62eaa/497c6/radio-check-buttons-css.png 400w,\n/static/56b8ac1b7f3b7dfdc03ce43aa1e62eaa/7d145/radio-check-buttons-css.png 610w","sizes":"(max-width: 610px) 100vw, 610px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}}]}},"pageContext":{"tag":"Java"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}