HttpAuthentication.apt.vm 4.4 KB

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