Configuration.apt.vm 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. Hadoop Auth, Java HTTP SPNEGO ${project.version} - Server Side
  14. Configuration
  15. ---
  16. ---
  17. ${maven.build.timestamp}
  18. Hadoop Auth, Java HTTP SPNEGO ${project.version} - Server Side
  19. Configuration
  20. \[ {{{./index.html}Go Back}} \]
  21. * Server Side Configuration Setup
  22. The {{{./apidocs/org/apache/hadoop/auth/server/AuthenticationFilter.html}
  23. AuthenticationFilter filter}} is Hadoop Auth's server side component.
  24. This filter must be configured in front of all the web application resources
  25. that required authenticated requests. For example:
  26. The Hadoop Auth and dependent JAR files must be in the web application
  27. classpath (commonly the <<<WEB-INF/lib>>> directory).
  28. Hadoop Auth uses SLF4J-API for logging. Auth Maven POM dependencies define
  29. the SLF4J API dependency but it does not define the dependency on a concrete
  30. logging implementation, this must be addded explicitly to the web
  31. application. For example, if the web applicationan uses Log4j, the
  32. SLF4J-LOG4J12 and LOG4J jar files must be part part of the web application
  33. classpath as well as the Log4j configuration file.
  34. ** Common Configuration parameters
  35. * <<<config.prefix>>>: If specified, all other configuration parameter names
  36. must start with the prefix. The default value is no prefix.
  37. * <<<[PREFIX.]type>>>: the authentication type keyword (<<<simple>>> or
  38. <<<kerberos>>>) or a
  39. {{{./apidocs/org/apache/hadoop/auth/server/AuthenticationHandler.html}
  40. Authentication handler implementation}}.
  41. * <<<[PREFIX.]signature.secret>>>: The secret to SHA-sign the generated
  42. authentication tokens. If a secret is not provided a random secret is
  43. generated at start up time. If using multiple web application instances
  44. behind a load-balancer a secret must be set for the application to work
  45. properly.
  46. * <<<[PREFIX.]token.validity>>>: The validity -in seconds- of the generated
  47. authentication token. The default value is <<<3600>>> seconds.
  48. * <<<[PREFIX.]cookie.domain>>>: domain to use for the HTTP cookie that stores
  49. the authentication token.
  50. * <<<[PREFIX.]cookie.path>>>: path to use for the HTTP cookie that stores the
  51. authentication token.
  52. ** Kerberos Configuration
  53. <<IMPORTANT>>: A KDC must be configured and running.
  54. To use Kerberos SPNEGO as the authentication mechanism, the authentication
  55. filter must be configured with the following init parameters:
  56. * <<<[PREFIX.]type>>>: the keyword <<<kerberos>>>.
  57. * <<<[PREFIX.]kerberos.principal>>>: The web-application Kerberos principal
  58. name. The Kerberos principal name must start with <<<HTTP/...>>>. For
  59. example: <<<HTTP/localhost@LOCALHOST>>>. There is no default value.
  60. * <<<[PREFIX.]kerberos.keytab>>>: The path to the keytab file containing
  61. the credentials for the kerberos principal. For example:
  62. <<</Users/tucu/tucu.keytab>>>. There is no default value.
  63. <<Example>>:
  64. +---+
  65. <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
  66. ...
  67. <filter>
  68. <filter-name>kerberosFilter</filter-name>
  69. <filter-class>org.apache.hadoop.security.auth.server.AuthenticationFilter</filter-class>
  70. <init-param>
  71. <param-name>type</param-name>
  72. <param-value>kerberos</param-value>
  73. </init-param>
  74. <init-param>
  75. <param-name>token.validity</param-name>
  76. <param-value>30</param-value>
  77. </init-param>
  78. <init-param>
  79. <param-name>cookie.domain</param-name>
  80. <param-value>.foo.com</param-value>
  81. </init-param>
  82. <init-param>
  83. <param-name>cookie.path</param-name>
  84. <param-value>/</param-value>
  85. </init-param>
  86. <init-param>
  87. <param-name>kerberos.principal</param-name>
  88. <param-value>HTTP/localhost@LOCALHOST</param-value>
  89. </init-param>
  90. <init-param>
  91. <param-name>kerberos.keytab</param-name>
  92. <param-value>/tmp/auth.keytab</param-value>
  93. </init-param>
  94. </filter>
  95. <filter-mapping>
  96. <filter-name>kerberosFilter</filter-name>
  97. <url-pattern>/kerberos/*</url-pattern>
  98. </filter-mapping>
  99. ...
  100. </web-app>
  101. +---+
  102. ** Pseudo/Simple Configuration
  103. To use Pseudo/Simple as the authentication mechanism (trusting the value of
  104. the query string parameter 'user.name'), the authentication filter must be
  105. configured with the following init parameters:
  106. * <<<[PREFIX.]type>>>: the keyword <<<simple>>>.
  107. * <<<[PREFIX.]simple.anonymous.allowed>>>: is a boolean parameter that
  108. indicates if anonymous requests are allowed or not. The default value is
  109. <<<false>>>.
  110. <<Example>>:
  111. +---+
  112. <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
  113. ...
  114. <filter>
  115. <filter-name>simpleFilter</filter-name>
  116. <filter-class>org.apache.hadoop.security.auth.server.AuthenticationFilter</filter-class>
  117. <init-param>
  118. <param-name>type</param-name>
  119. <param-value>simple</param-value>
  120. </init-param>
  121. <init-param>
  122. <param-name>token.validity</param-name>
  123. <param-value>30</param-value>
  124. </init-param>
  125. <init-param>
  126. <param-name>cookie.domain</param-name>
  127. <param-value>.foo.com</param-value>
  128. </init-param>
  129. <init-param>
  130. <param-name>cookie.path</param-name>
  131. <param-value>/</param-value>
  132. </init-param>
  133. <init-param>
  134. <param-name>simple.anonymous.allowed</param-name>
  135. <param-value>false</param-value>
  136. </init-param>
  137. </filter>
  138. <filter-mapping>
  139. <filter-name>simpleFilter</filter-name>
  140. <url-pattern>/simple/*</url-pattern>
  141. </filter-mapping>
  142. ...
  143. </web-app>
  144. +---+
  145. ** AltKerberos Configuration
  146. <<IMPORTANT>>: A KDC must be configured and running.
  147. The AltKerberos authentication mechanism is a partially implemented derivative
  148. of the Kerberos SPNEGO authentication mechanism which allows a "mixed" form of
  149. authentication where Kerberos SPNEGO is used by non-browsers while an
  150. alternate form of authentication (to be implemented by the user) is used for
  151. browsers. To use AltKerberos as the authentication mechanism (besides
  152. providing an implementation), the authentication filter must be configured
  153. with the following init parameters, in addition to the previously mentioned
  154. Kerberos SPNEGO ones:
  155. * <<<[PREFIX.]type>>>: the full class name of the implementation of
  156. AltKerberosAuthenticationHandler to use.
  157. * <<<[PREFIX.]alt-kerberos.non-browser.user-agents>>>: a comma-separated
  158. list of which user-agents should be considered non-browsers.
  159. <<Example>>:
  160. +---+
  161. <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
  162. ...
  163. <filter>
  164. <filter-name>kerberosFilter</filter-name>
  165. <filter-class>org.apache.hadoop.security.auth.server.AuthenticationFilter</filter-class>
  166. <init-param>
  167. <param-name>type</param-name>
  168. <param-value>org.my.subclass.of.AltKerberosAuthenticationHandler</param-value>
  169. </init-param>
  170. <init-param>
  171. <param-name>alt-kerberos.non-browser.user-agents</param-name>
  172. <param-value>java,curl,wget,perl</param-value>
  173. </init-param>
  174. <init-param>
  175. <param-name>token.validity</param-name>
  176. <param-value>30</param-value>
  177. </init-param>
  178. <init-param>
  179. <param-name>cookie.domain</param-name>
  180. <param-value>.foo.com</param-value>
  181. </init-param>
  182. <init-param>
  183. <param-name>cookie.path</param-name>
  184. <param-value>/</param-value>
  185. </init-param>
  186. <init-param>
  187. <param-name>kerberos.principal</param-name>
  188. <param-value>HTTP/localhost@LOCALHOST</param-value>
  189. </init-param>
  190. <init-param>
  191. <param-name>kerberos.keytab</param-name>
  192. <param-value>/tmp/auth.keytab</param-value>
  193. </init-param>
  194. </filter>
  195. <filter-mapping>
  196. <filter-name>kerberosFilter</filter-name>
  197. <url-pattern>/kerberos/*</url-pattern>
  198. </filter-mapping>
  199. ...
  200. </web-app>
  201. +---+
  202. \[ {{{./index.html}Go Back}} \]