HttpAuthentication.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?xml version="1.0"?>
  2. <!--
  3. Copyright 2002-2004 The Apache Software Foundation
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. -->
  14. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN"
  15. "http://forrest.apache.org/dtd/document-v20.dtd">
  16. <document>
  17. <header>
  18. <title>
  19. Authentication for Hadoop HTTP web-consoles
  20. </title>
  21. </header>
  22. <body>
  23. <section>
  24. <title> Introduction </title>
  25. <p>
  26. This document describes how to configure Hadoop HTTP web-consoles to require user
  27. authentication.
  28. </p>
  29. <p>
  30. By default Hadoop HTTP web-consoles (JobTracker, NameNode, TaskTrackers and DataNodes) allow
  31. access without any form of authentication.
  32. </p>
  33. <p>
  34. Similarly to Hadoop RPC, Hadoop HTTP web-consoles can be configured to require Kerberos
  35. authentication using HTTP SPNEGO protocol (supported by browsers like Firefox and Internet
  36. Explorer).
  37. </p>
  38. <p>
  39. In addition, Hadoop HTTP web-consoles support the equivalent of Hadoop's Pseudo/Simple
  40. authentication. If this option is enabled, user must specify their user name in the first
  41. browser interaction using the <code>user.name</code> query string parameter. For example:
  42. <code>http://localhost:50030/jobtracker.jsp?user.name=babu</code>.
  43. </p>
  44. <p>
  45. If a custom authentication mechanism is required for the HTTP web-consoles, it is possible
  46. to implement a plugin to support the alternate authentication mechanism (refer to
  47. Hadoop hadoop-auth for details on writing an <code>AuthenticatorHandler</code>).
  48. </p>
  49. <p>
  50. The next section describes how to configure Hadoop HTTP web-consoles to require user
  51. authentication.
  52. </p>
  53. </section>
  54. <section>
  55. <title> Configuration </title>
  56. <p>
  57. The following properties should be in the <code>core-site.xml</code> of all the nodes
  58. in the cluster.
  59. </p>
  60. <p><code>hadoop.http.filter.initializers</code>: add to this property the
  61. <code>org.apache.hadoop.security.AuthenticationFilterInitializer</code> initializer class.
  62. </p>
  63. <p><code>hadoop.http.authentication.type</code>: Defines authentication used for the HTTP
  64. web-consoles. The supported values are: <code>simple | kerberos |
  65. #AUTHENTICATION_HANDLER_CLASSNAME#</code>. The dfeault value is <code>simple</code>.
  66. </p>
  67. <p><code>hadoop.http.authentication.token.validity</code>: Indicates how long (in seconds)
  68. an authentication token is valid before it has to be renewed. The default value is
  69. <code>36000</code>.
  70. </p>
  71. <p><code>hadoop.http.authentication.signature.secret.file</code>: The signature secret
  72. file for signing the authentication tokens. If not set a random secret is generated at
  73. startup time. The same secret should be used for all nodes in the cluster, JobTracker,
  74. NameNode, DataNode and TastTracker. The default value is
  75. <code>${user.home}/hadoop-http-auth-signature-secret</code>.
  76. IMPORTANT: This file should be readable only by the Unix user running the daemons.
  77. </p>
  78. <p><code>hadoop.http.authentication.cookie.domain</code>: The domain to use for the HTTP
  79. cookie that stores the authentication token. In order to authentiation to work
  80. correctly across all nodes in the cluster the domain must be correctly set.
  81. There is no default value, the HTTP cookie will not have a domain working only
  82. with the hostname issuing the HTTP cookie.
  83. </p>
  84. <p>
  85. IMPORTANT: when using IP addresses, browsers ignore cookies with domain settings.
  86. For this setting to work properly all nodes in the cluster must be configured
  87. to generate URLs with hostname.domain names on it.
  88. </p>
  89. <p><code>hadoop.http.authentication.simple.anonymous.allowed</code>: Indicates if anonymous
  90. requests are allowed when using 'simple' authentication. The default value is
  91. <code>true</code>
  92. </p>
  93. <p><code>hadoop.http.authentication.kerberos.principal</code>: Indicates the Kerberos
  94. principal to be used for HTTP endpoint when using 'kerberos' authentication.
  95. The principal short name must be <code>HTTP</code> per Kerberos HTTP SPNEGO specification.
  96. The default value is <code>HTTP/_HOST@$LOCALHOST</code>, where <code>_HOST</code> -if present-
  97. is replaced with bind address of the HTTP server.
  98. </p>
  99. <p><code>hadoop.http.authentication.kerberos.keytab</code>: Location of the keytab file
  100. with the credentials for the Kerberos principal used for the HTTP endpoint.
  101. The default value is <code>${user.home}/hadoop.keytab</code>.i
  102. </p>
  103. </section>
  104. </body>
  105. </document>