You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2020/09/04 00:40:33 UTC

[GitHub] [knox] lmccay opened a new pull request #372: KNOX-2412 - Add Logout Link to Home Page for Select Authentication Pr…

lmccay opened a new pull request #372:
URL: https://github.com/apache/knox/pull/372


   …oviders
   
   Change-Id: I963d526cc560d0e2e00745c9b42c7ad63ed29450
   
   (It is very **important** that you created an Apache Knox JIRA for this change and that the PR title/commit message includes the Apache Knox JIRA ID!)
   
   ## What changes were proposed in this pull request?
   
   * Logout Button on Homepage
   * Homepage Logout Configurable from gateway-site.xml
   * KNOXSSOUT service changed to be able to be hosted in arbitrary topologies - may break existing use of this service in a dedicated knoxssout.xml topology which was the original intent but it was never really documented as supported.
   * KNOX-SESSION API added to return authenticated user and optionally logoutUrl
   * A SessionInformation section added to the Homepage with a Welcome {username} and logout button
   * KNOXSSOUT and KNOX-SESSION added to homepage.xml topology by default
   * homePageLogoutEnabled defaults to true since the default KnoxSSO with form based IDP is supported.
   
   ## How was this patch tested?
   * Existing unit tests run
   * SessionResourceTest unit test added
   
   ![image](https://user-images.githubusercontent.com/2303672/92186654-79082900-ee25-11ea-932c-ffa6b93fc659.png)
   
   Please review [Knox Contributing Process](https://cwiki.apache.org/confluence/display/KNOX/Contribution+Process#ContributionProcess-GithubWorkflow) before opening a pull request.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [knox] smolnar82 commented on a change in pull request #372: KNOX-2412 - Add Logout Link to Home Page for Select Authentication Pr…

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on a change in pull request #372:
URL: https://github.com/apache/knox/pull/372#discussion_r483424710



##########
File path: gateway-release/pom.xml
##########
@@ -451,7 +451,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.knox</groupId>
-            <artifactId>gateway-service-metadata</artifactId>
+            <artifactId>gateway-service-session</artifactId>

Review comment:
       Why not add the new service as a separate dependency?

##########
File path: gateway-service-knoxssout/src/main/java/org/apache/knox/gateway/service/knoxsso/WebSSOutResource.java
##########
@@ -44,7 +44,7 @@
   private static final String SSO_COOKIE_NAME = "knoxsso.cookie.name";
   private static final String DEFAULT_SSO_COOKIE_NAME = "hadoop-jwt";
 
-  static final String RESOURCE_PATH = "/api/v1/webssout";
+  static final String RESOURCE_PATH = "knoxssout/api/v1/webssout";

Review comment:
       I don't get why do we need the `knoxssout`. This change makes the SSOUT API inconsistent with the rest of the APIs.

##########
File path: gateway-service-session/src/main/java/org/apache/knox/gateway/service/session/SessionResource.java
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.knox.gateway.service.session;
+
+import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
+import static javax.ws.rs.core.MediaType.APPLICATION_XML;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import org.apache.knox.gateway.config.GatewayConfig;
+import org.apache.knox.gateway.i18n.messages.MessagesFactory;
+import org.apache.knox.gateway.security.SubjectUtils;
+
+@Singleton
+@Path("session/api/v1/")

Review comment:
       Perhaps changing this to `api/v1/session` to be consistent with another API endpoints?

##########
File path: knox-homepage-ui/home/app/sessionInformation/session.information.component.ts
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import {Component, OnInit} from '@angular/core';
+import {HomepageService} from '../homepage.service';
+import {SessionInformation} from './session.information';
+
+@Component({
+    selector: 'app-session-information',
+    templateUrl: './session.information.component.html',
+    providers: [HomepageService]
+})
+
+export class SessionInformationComponent implements OnInit {
+
+    sessionInformation: SessionInformation;
+    logoutSupported = true;
+
+    constructor(private homepageService: HomepageService) {
+        this['showSessionInformation'] = true;
+    }
+
+    getUser() {
+        if (this.sessionInformation) {
+            console.debug('SessionInformationComponent --> getUser() --> ' + this.sessionInformation.user);
+            return this.sessionInformation.user;
+        }
+        console.debug('SessionInformationComponent --> getUser() --> dr.who');
+        return 'dr.who';
+    }
+
+    getLogoutUrl() {
+        if (this.sessionInformation) {
+            console.debug('SessionInformationComponent --> getLogoutUrl() --> ' + this.sessionInformation.logoutUrl);
+            return this.sessionInformation.logoutUrl;
+        }
+        return null;
+    }
+
+    logout() {
+        // window.alert('Are you sure???');
+        console.debug('SessionInformationComponent --> attempting logout() --> ');
+        if (this.sessionInformation) {
+            if (this.getLogoutUrl() == null) {
+                window.alert('Logout for the configured is IDP not supported.\nPlease close all browser windows to logout.');

Review comment:
       There is a more elegant way of notifying the end-users: using a module called `sweetalert` (https://www.npmjs.com/package/sweetalert). It's been used both on the Admin UI and on the Home Page. See this usage for instance:
   https://github.com/apache/knox/blob/master/knox-homepage-ui/home/app/homepage.service.ts#L81

##########
File path: knox-homepage-ui/home/app/sessionInformation/session.information.component.ts
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import {Component, OnInit} from '@angular/core';
+import {HomepageService} from '../homepage.service';
+import {SessionInformation} from './session.information';
+
+@Component({
+    selector: 'app-session-information',
+    templateUrl: './session.information.component.html',
+    providers: [HomepageService]
+})
+
+export class SessionInformationComponent implements OnInit {
+
+    sessionInformation: SessionInformation;
+    logoutSupported = true;
+
+    constructor(private homepageService: HomepageService) {
+        this['showSessionInformation'] = true;
+    }
+
+    getUser() {
+        if (this.sessionInformation) {
+            console.debug('SessionInformationComponent --> getUser() --> ' + this.sessionInformation.user);
+            return this.sessionInformation.user;
+        }
+        console.debug('SessionInformationComponent --> getUser() --> dr.who');
+        return 'dr.who';
+    }
+
+    getLogoutUrl() {
+        if (this.sessionInformation) {
+            console.debug('SessionInformationComponent --> getLogoutUrl() --> ' + this.sessionInformation.logoutUrl);
+            return this.sessionInformation.logoutUrl;
+        }
+        return null;
+    }
+
+    logout() {
+        // window.alert('Are you sure???');
+        console.debug('SessionInformationComponent --> attempting logout() --> ');
+        if (this.sessionInformation) {
+            if (this.getLogoutUrl() == null) {

Review comment:
       I'd use `this.logoutSupported` so that the logic if logout is supported happens in one place only (in `setSessionInformation`).

##########
File path: knox-homepage-ui/home/app/sessionInformation/session.information.component.ts
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import {Component, OnInit} from '@angular/core';
+import {HomepageService} from '../homepage.service';
+import {SessionInformation} from './session.information';
+
+@Component({
+    selector: 'app-session-information',
+    templateUrl: './session.information.component.html',
+    providers: [HomepageService]
+})
+
+export class SessionInformationComponent implements OnInit {
+
+    sessionInformation: SessionInformation;
+    logoutSupported = true;
+
+    constructor(private homepageService: HomepageService) {
+        this['showSessionInformation'] = true;
+    }
+
+    getUser() {
+        if (this.sessionInformation) {
+            console.debug('SessionInformationComponent --> getUser() --> ' + this.sessionInformation.user);
+            return this.sessionInformation.user;
+        }
+        console.debug('SessionInformationComponent --> getUser() --> dr.who');
+        return 'dr.who';

Review comment:
       Why not returning `null`?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [knox] lmccay commented on a change in pull request #372: KNOX-2412 - Add Logout Link to Home Page for Select Authentication Pr…

Posted by GitBox <gi...@apache.org>.
lmccay commented on a change in pull request #372:
URL: https://github.com/apache/knox/pull/372#discussion_r483864126



##########
File path: knox-homepage-ui/home/app/sessionInformation/session.information.component.ts
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import {Component, OnInit} from '@angular/core';
+import {HomepageService} from '../homepage.service';
+import {SessionInformation} from './session.information';
+
+@Component({
+    selector: 'app-session-information',
+    templateUrl: './session.information.component.html',
+    providers: [HomepageService]
+})
+
+export class SessionInformationComponent implements OnInit {
+
+    sessionInformation: SessionInformation;
+    logoutSupported = true;
+
+    constructor(private homepageService: HomepageService) {
+        this['showSessionInformation'] = true;
+    }
+
+    getUser() {
+        if (this.sessionInformation) {
+            console.debug('SessionInformationComponent --> getUser() --> ' + this.sessionInformation.user);
+            return this.sessionInformation.user;
+        }
+        console.debug('SessionInformationComponent --> getUser() --> dr.who');
+        return 'dr.who';
+    }
+
+    getLogoutUrl() {
+        if (this.sessionInformation) {
+            console.debug('SessionInformationComponent --> getLogoutUrl() --> ' + this.sessionInformation.logoutUrl);
+            return this.sessionInformation.logoutUrl;
+        }
+        return null;
+    }
+
+    logout() {
+        // window.alert('Are you sure???');
+        console.debug('SessionInformationComponent --> attempting logout() --> ');
+        if (this.sessionInformation) {
+            if (this.getLogoutUrl() == null) {

Review comment:
       Good point. I'll make that change - thanks!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [knox] lmccay commented on a change in pull request #372: KNOX-2412 - Add Logout Link to Home Page for Select Authentication Pr…

Posted by GitBox <gi...@apache.org>.
lmccay commented on a change in pull request #372:
URL: https://github.com/apache/knox/pull/372#discussion_r483860769



##########
File path: gateway-release/pom.xml
##########
@@ -451,7 +451,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.knox</groupId>
-            <artifactId>gateway-service-metadata</artifactId>
+            <artifactId>gateway-service-session</artifactId>

Review comment:
       Not sure why the patch only shows up like this but the original gateway-service-metadata is still in there. I had originally copy and pasted it but forgot to change the name then went back and changed it. The merged file looks fine.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [knox] lmccay commented on a change in pull request #372: KNOX-2412 - Add Logout Link to Home Page for Select Authentication Pr…

Posted by GitBox <gi...@apache.org>.
lmccay commented on a change in pull request #372:
URL: https://github.com/apache/knox/pull/372#discussion_r483635899



##########
File path: gateway-release/pom.xml
##########
@@ -451,7 +451,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.knox</groupId>
-            <artifactId>gateway-service-metadata</artifactId>
+            <artifactId>gateway-service-session</artifactId>

Review comment:
       Don't know what you mean here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [knox] lmccay commented on a change in pull request #372: KNOX-2412 - Add Logout Link to Home Page for Select Authentication Pr…

Posted by GitBox <gi...@apache.org>.
lmccay commented on a change in pull request #372:
URL: https://github.com/apache/knox/pull/372#discussion_r483861210



##########
File path: gateway-service-session/src/main/java/org/apache/knox/gateway/service/session/SessionResource.java
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.knox.gateway.service.session;
+
+import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
+import static javax.ws.rs.core.MediaType.APPLICATION_XML;
+
+import javax.inject.Singleton;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import org.apache.knox.gateway.config.GatewayConfig;
+import org.apache.knox.gateway.i18n.messages.MessagesFactory;
+import org.apache.knox.gateway.security.SubjectUtils;
+
+@Singleton
+@Path("session/api/v1/")

Review comment:
       I don't believe so - this is the session API, for now there is a sessioninfo but we could potentially add other things to it. It can be added to any topology and addressed via the session context path.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [knox] lmccay merged pull request #372: KNOX-2412 - Add Logout Link to Home Page for Select Authentication Pr…

Posted by GitBox <gi...@apache.org>.
lmccay merged pull request #372:
URL: https://github.com/apache/knox/pull/372


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [knox] lmccay commented on a change in pull request #372: KNOX-2412 - Add Logout Link to Home Page for Select Authentication Pr…

Posted by GitBox <gi...@apache.org>.
lmccay commented on a change in pull request #372:
URL: https://github.com/apache/knox/pull/372#discussion_r483635437



##########
File path: gateway-service-knoxssout/src/main/java/org/apache/knox/gateway/service/knoxsso/WebSSOutResource.java
##########
@@ -44,7 +44,7 @@
   private static final String SSO_COOKIE_NAME = "knoxsso.cookie.name";
   private static final String DEFAULT_SSO_COOKIE_NAME = "hadoop-jwt";
 
-  static final String RESOURCE_PATH = "/api/v1/webssout";
+  static final String RESOURCE_PATH = "knoxssout/api/v1/webssout";

Review comment:
       Not all of the other APIs do that. It was done that way for APIs that were initially intended to be deployed to a single dedicated topology. Like the admin.xml.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [knox] lmccay commented on a change in pull request #372: KNOX-2412 - Add Logout Link to Home Page for Select Authentication Pr…

Posted by GitBox <gi...@apache.org>.
lmccay commented on a change in pull request #372:
URL: https://github.com/apache/knox/pull/372#discussion_r483634252



##########
File path: knox-homepage-ui/home/app/sessionInformation/session.information.component.ts
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import {Component, OnInit} from '@angular/core';
+import {HomepageService} from '../homepage.service';
+import {SessionInformation} from './session.information';
+
+@Component({
+    selector: 'app-session-information',
+    templateUrl: './session.information.component.html',
+    providers: [HomepageService]
+})
+
+export class SessionInformationComponent implements OnInit {
+
+    sessionInformation: SessionInformation;
+    logoutSupported = true;
+
+    constructor(private homepageService: HomepageService) {
+        this['showSessionInformation'] = true;
+    }
+
+    getUser() {
+        if (this.sessionInformation) {
+            console.debug('SessionInformationComponent --> getUser() --> ' + this.sessionInformation.user);
+            return this.sessionInformation.user;
+        }
+        console.debug('SessionInformationComponent --> getUser() --> dr.who');
+        return 'dr.who';
+    }
+
+    getLogoutUrl() {
+        if (this.sessionInformation) {
+            console.debug('SessionInformationComponent --> getLogoutUrl() --> ' + this.sessionInformation.logoutUrl);
+            return this.sessionInformation.logoutUrl;
+        }
+        return null;
+    }
+
+    logout() {
+        // window.alert('Are you sure???');
+        console.debug('SessionInformationComponent --> attempting logout() --> ');
+        if (this.sessionInformation) {
+            if (this.getLogoutUrl() == null) {
+                window.alert('Logout for the configured is IDP not supported.\nPlease close all browser windows to logout.');

Review comment:
       This isn't being used now since it doesn't render the button at all for now. I'm not sure which is better which is why I left it here for now. A missing logout button may seem like a bug but a logout button that doesn't log you out may be bad as well. At least it is known to be intentional and provides some insights though. Planned to follow up with discussion on this. If we go that route we can use sweetalert instead for sure.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [knox] lmccay commented on a change in pull request #372: KNOX-2412 - Add Logout Link to Home Page for Select Authentication Pr…

Posted by GitBox <gi...@apache.org>.
lmccay commented on a change in pull request #372:
URL: https://github.com/apache/knox/pull/372#discussion_r483634690



##########
File path: knox-homepage-ui/home/app/sessionInformation/session.information.component.ts
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import {Component, OnInit} from '@angular/core';
+import {HomepageService} from '../homepage.service';
+import {SessionInformation} from './session.information';
+
+@Component({
+    selector: 'app-session-information',
+    templateUrl: './session.information.component.html',
+    providers: [HomepageService]
+})
+
+export class SessionInformationComponent implements OnInit {
+
+    sessionInformation: SessionInformation;
+    logoutSupported = true;
+
+    constructor(private homepageService: HomepageService) {
+        this['showSessionInformation'] = true;
+    }
+
+    getUser() {
+        if (this.sessionInformation) {
+            console.debug('SessionInformationComponent --> getUser() --> ' + this.sessionInformation.user);
+            return this.sessionInformation.user;
+        }
+        console.debug('SessionInformationComponent --> getUser() --> dr.who');
+        return 'dr.who';

Review comment:
       dr.who is common in Hadoop world. While I don't like it - it is better than the UI saying "Welcome null". :)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org