Repository: nifi
Updated Branches:
  refs/heads/master 505e93065 -> 528b82634


http://git-wip-us.apache.org/repos/asf/nifi/blob/528b8263/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/message-page.jsp
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/message-page.jsp
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/message-page.jsp
index 98e5f45..1c82a62 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/message-page.jsp
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/pages/message-page.jsp
@@ -32,18 +32,37 @@
     <head>
         <title><%= request.getAttribute("title") == null ? "" : 
org.apache.nifi.util.EscapeUtils.escapeHtml(request.getAttribute("title").toString())
 %></title>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-        <link rel="shortcut icon" href="images/nifi16.ico"/>
+        <link rel="shortcut icon" href="<%= contextPath %>/images/nifi16.ico"/>
         <link rel="stylesheet" href="<%= contextPath 
%>/nifi/assets/reset.css/reset.css" type="text/css" />
         <link rel="stylesheet" href="<%= contextPath 
%>/nifi/css/common-ui.css" type="text/css" />
         <link rel="stylesheet" href="<%= contextPath 
%>/nifi/fonts/flowfont/flowfont.css" type="text/css" />
         <link rel="stylesheet" href="<%= contextPath 
%>/nifi/assets/font-awesome/css/font-awesome.min.css" type="text/css" />
         <link rel="stylesheet" href="<%= contextPath 
%>/nifi/css/message-pane.css" type="text/css" />
         <link rel="stylesheet" href="<%= contextPath 
%>/nifi/css/message-page.css" type="text/css" />
+        <script type="text/javascript" src="<%= contextPath 
%>/nifi/assets/jquery/dist/jquery.min.js"></script>
+        <script type="text/javascript">
+            $(document).ready(function () {
+                $('#user-home').on('mouseenter', function () {
+                    $(this).addClass('link-over');
+                }).on('mouseleave', function () {
+                    $(this).removeClass('link-over');
+                }).on('click', function () {
+                    window.location = '<%= contextPath %>/nifi';
+                });
+            });
+        </script>
     </head>
 
     <body class="message-pane">
         <div class="message-pane-message-box">
             <div class="message-pane-title"><%= request.getAttribute("title") 
== null ? "" : 
org.apache.nifi.util.EscapeUtils.escapeHtml(request.getAttribute("title").toString())
 %></div>
+            <div id="user-links-container" style="margin-left: 20px; float: 
left;">
+                <ul class="links">
+                    <li>
+                        <span id="user-home" class="link">home</span>
+                    </li>
+                </ul>
+            </div>
             <div class="message-pane-content"><%= 
request.getAttribute("messages") == null ? "" : 
org.apache.nifi.util.EscapeUtils.escapeHtml(request.getAttribute("messages").toString())
 %></div>
         </div>
     </body>

http://git-wip-us.apache.org/repos/asf/nifi/blob/528b8263/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/web.xml
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/web.xml
index ce75dea..b758a67 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/web.xml
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/web.xml
@@ -15,7 +15,7 @@
 -->
 <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";>
     <display-name>nifi</display-name>
-    
+
     <!-- servlet to map to canvas page -->
     <servlet>
         <servlet-name>NiFiCanvas</servlet-name>
@@ -25,7 +25,7 @@
         <servlet-name>NiFiCanvas</servlet-name>
         <url-pattern>/canvas</url-pattern>
     </servlet-mapping>
-    
+
     <!-- servlet to map to summary page -->
     <servlet>
         <servlet-name>NiFiSummary</servlet-name>
@@ -35,7 +35,7 @@
         <servlet-name>NiFiSummary</servlet-name>
         <url-pattern>/summary</url-pattern>
     </servlet-mapping>
-    
+
     <!-- servlet to map to history page -->
     <servlet>
         <servlet-name>NiFiHistory</servlet-name>
@@ -45,7 +45,7 @@
         <servlet-name>NiFiHistory</servlet-name>
         <url-pattern>/history</url-pattern>
     </servlet-mapping>
-    
+
     <!-- servlet to map to provenance page -->
     <servlet>
         <servlet-name>NiFiProvenance</servlet-name>
@@ -55,7 +55,7 @@
         <servlet-name>NiFiProvenance</servlet-name>
         <url-pattern>/provenance</url-pattern>
     </servlet-mapping>
-    
+
     <!-- servlet to map to counters page -->
     <servlet>
         <servlet-name>NiFiCounters</servlet-name>
@@ -65,7 +65,7 @@
         <servlet-name>NiFiCounters</servlet-name>
         <url-pattern>/counters</url-pattern>
     </servlet-mapping>
-    
+
     <!-- servlet to map to templates page -->
     <servlet>
         <servlet-name>NiFiTemplates</servlet-name>
@@ -75,7 +75,7 @@
         <servlet-name>NiFiTemplates</servlet-name>
         <url-pattern>/templates</url-pattern>
     </servlet-mapping>
-    
+
     <!-- servlet to map to users page -->
     <servlet>
         <servlet-name>NiFiUsers</servlet-name>
@@ -85,7 +85,7 @@
         <servlet-name>NiFiUsers</servlet-name>
         <url-pattern>/users</url-pattern>
     </servlet-mapping>
-    
+
     <!-- servlet to map to cluster page -->
     <servlet>
         <servlet-name>NiFiCluster</servlet-name>
@@ -95,7 +95,7 @@
         <servlet-name>NiFiCluster</servlet-name>
         <url-pattern>/cluster</url-pattern>
     </servlet-mapping>
-    
+
     <!-- servlet to map to bulletin board page -->
     <servlet>
         <servlet-name>BulletinBoard</servlet-name>
@@ -105,7 +105,7 @@
         <servlet-name>BulletinBoard</servlet-name>
         <url-pattern>/bulletin-board</url-pattern>
     </servlet-mapping>
-    
+
     <!-- servlet to support message page -->
     <servlet>
         <servlet-name>MessagePage</servlet-name>
@@ -115,7 +115,7 @@
         <servlet-name>MessagePage</servlet-name>
         <url-pattern>/message</url-pattern>
     </servlet-mapping>
-    
+
     <!-- servlet to login page -->
     <servlet>
         <servlet-name>Login</servlet-name>
@@ -125,7 +125,17 @@
         <servlet-name>Login</servlet-name>
         <url-pattern>/login</url-pattern>
     </servlet-mapping>
-    
+
+    <!-- login filter -->
+    <filter>
+        <filter-name>LoginFilter</filter-name>
+        <filter-class>org.apache.nifi.web.filter.LoginFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>LoginFilter</filter-name>
+        <url-pattern>/login</url-pattern>
+    </filter-mapping>
+
     <welcome-file-list>
         <welcome-file>canvas.jsp</welcome-file>
         <welcome-file>/WEB-INF/pages/canvas.jsp</welcome-file>

http://git-wip-us.apache.org/repos/asf/nifi/blob/528b8263/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
index 0180441..49ded8c 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
@@ -99,6 +99,7 @@
             currentUser: '../nifi-api/flow/current-user',
             controllerBulletins: '../nifi-api/flow/controller/bulletins',
             kerberos: '../nifi-api/access/kerberos',
+            oidc: '../nifi-api/access/oidc/exchange',
             revision: '../nifi-api/flow/revision',
             banners: '../nifi-api/flow/banners'
         }
@@ -780,8 +781,16 @@
          * Initialize NiFi.
          */
         init: function () {
-            // attempt kerberos authentication
+            // attempt kerberos/oidc authentication
             var ticketExchange = $.Deferred(function (deferred) {
+                var successfulAuthentication = function (jwt) {
+                    // get the payload and store the token with the 
appropriate expiration
+                    var token = nfCommon.getJwtPayload(jwt);
+                    var expiration = parseInt(token['exp'], 10) * 
nfCommon.MILLIS_PER_SECOND;
+                    nfStorage.setItem('jwt', jwt, expiration);
+                    deferred.resolve();
+                };
+
                 if (nfStorage.hasItem('jwt')) {
                     deferred.resolve();
                 } else {
@@ -790,13 +799,17 @@
                         url: config.urls.kerberos,
                         dataType: 'text'
                     }).done(function (jwt) {
-                        // get the payload and store the token with the 
appropriate expiration
-                        var token = nfCommon.getJwtPayload(jwt);
-                        var expiration = parseInt(token['exp'], 10) * 
nfCommon.MILLIS_PER_SECOND;
-                        nfStorage.setItem('jwt', jwt, expiration);
-                        deferred.resolve();
+                        successfulAuthentication(jwt);
                     }).fail(function () {
-                        deferred.reject();
+                        $.ajax({
+                            type: 'POST',
+                            url: config.urls.oidc,
+                            dataType: 'text'
+                        }).done(function (jwt) {
+                            successfulAuthentication(jwt)
+                        }).fail(function () {
+                            deferred.reject();
+                        });
                     });
                 }
             }).promise();
@@ -822,7 +835,7 @@
                     }).fail(function (xhr, status, error) {
                         // there is no anonymous access and we don't know this 
user - open the login page which handles login/registration/etc
                         if (xhr.status === 401) {
-                            window.location = '/nifi/login';
+                            window.location = '../nifi/login';
                         } else {
                             deferred.reject(xhr, status, error);
                         }

http://git-wip-us.apache.org/repos/asf/nifi/blob/528b8263/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7c74125..9a00d09 100644
--- a/pom.xml
+++ b/pom.xml
@@ -95,7 +95,7 @@
         <jetty.version>9.4.3.v20170317</jetty.version>
         <lucene.version>4.10.4</lucene.version>
         <spring.version>4.2.4.RELEASE</spring.version>
-        <spring.security.version>4.0.3.RELEASE</spring.security.version>
+        <spring.security.version>4.2.3.RELEASE</spring.security.version>
         <jersey.version>1.19</jersey.version>
         <hadoop.version>2.7.3</hadoop.version>
         <hadoop.guava.version>12.0.1</hadoop.guava.version>
@@ -377,6 +377,11 @@
                 </exclusions>
             </dependency>
             <dependency>
+                <groupId>com.nimbusds</groupId>
+                <artifactId>oauth2-oidc-sdk</artifactId>
+                <version>5.34</version>
+            </dependency>
+            <dependency>
                 <groupId>com.sun.jersey.contribs</groupId>
                 <artifactId>jersey-multipart</artifactId>
                 <version>${jersey.version}</version>

Reply via email to