ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/webapps/docs/config/jaspic.xml

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/webapps/docs/config/jaspic.xml
Status
scanned
Type
file
Name
jaspic.xml
Extension
.xml
Programming language

      
    
Mime type
text/xml
File type
XML 1.0 document, ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
8558 (8.4 KB)
MD5
e015365f5e919c998e0c454fd5739266
SHA1
2abc01ca6938cf94b6164f9d16c3670a7acbf53f
SHA256
c3799ce2d850e3e60a2faf9e489a58a70adc4ea87ca50f402c5f3577f3805b50
SHA512

      
    
SHA1_git
f2f203e33eb84d60c49f276cb1f92e789bb30928
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
jaspic.xml | 8.4 KB |

<?xml version="1.0" encoding="UTF-8"?> <!-- 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. --> <!DOCTYPE document [ <!ENTITY project SYSTEM "project.xml"> ]> <document url="jaspic.html"> &project; <properties> <title>Jakarta Authentication (formerly JASPIC)</title> </properties> <body> <section name="Table of Contents"> <toc /> </section> <section name="Introduction"> <p>Tomcat implements <a href="https://jakarta.ee/specifications/authentication/3.1/">Jakarta Authentication 3.1</a>. The implementation is primarily intended to enable the integration of 3rd party authentication implementations with Tomcat.</p> <p>Jakarta Authentication may be configured in one of two ways:</p> <ul> <li>At the container level via the static configuration file <code>$CATALINA_BASE/conf/jaspic-providers.xml</code>. With this approach all required classes must be visible to Tomcat's Common class loader which normally means placing a JAR in <code>$CATALINA_BASE/lib</code>.</li> <li>At the web application level via dynamic configuration using the Jakarta Authentication API. With this approach all required classes must be visible to the web application class loader which normally means placing a JAR in the web application's <code>WEB-INF/lib</code> directory.</li> </ul> <p>Users should be aware that if the static Jakarta Authentication configuration file configures Jakarta Authentication for a given web application then the Jakarta Authentication configuration will take precedence over any <code>&lt;login-config&gt;</code> present in the web application's <code>WEB-INF/web.xml</code> file.</p> </section> <section name="Static configuration"> <subsection name="AuthConfigProvider"> <p>If the 3rd party implementation includes an <code>AuthConfigProvider</code> then a web application can be configured to use it by nesting the following inside the <code>&lt;jaspic-providers&gt;</code> element in <code>$CATALINA_BASE/conf/jaspic-providers.xml</code>.</p> <source><![CDATA[<provider name="any" className="fully.qualified.implementation.class.Name" layer="HttpServlet" appContext="Catalina/localhost /contextPath" description="any"> <property name="see-provider-documentation" value="see-provider-documentation" /> </provider>]]></source> <p>The <code>name</code> and <code>description</code> attributes are not used by Tomcat.</p> <p>The <code>className</code> attribute must be the fully qualified class name of the <code>AuthConfigProvider</code>. The implementation may be packaged with the web application or in Tomcat&apos;s <code>$CATALINA_BASE/lib</code> directory.</p> <p>The <code>layer</code> attribute must be <code>HttpServlet</code>.</p> <p>The <code>appContext</code> attribute must be exactly the concatenation of:</p> <ul> <li>The engine name</li> <li>The forward slash character</li> <li>The host name</li> <li>A single space</li> <li>The context path</li> </ul> <p>If the <code>AuthConfigProvider</code> supports configuration via properties these may be specified via <code>&lt;property&gt;</code> elements nesting inside the <code>&lt;provide&gt;</code> element.</p> </subsection> <subsection name="ServerAuthModule"> <p>If the 3rd party implementation only provides an <code>ServerAuthModule</code> then it will be necessary to provide a number of supporting classes. These may be a custom implementation or, alternatively, Tomcat provides a simple wrapper implementation for <code>ServerAuthModule</code>s. </p> <p>Tomcat&apos;s wrapper for <code>ServerAuthModule</code> can be configured by nesting the following inside the <code>&lt;jaspic-providers&gt;</code> element in <code>$CATALINA_BASE/conf/jaspic-providers.xml</code>.</p> <source><![CDATA[<provider name="any" className="org.apache.catalina.authenticator.jaspic.SimpleAuthConfigProvider" layer="HttpServlet" appContext="Catalina/localhost /contextPath" description="any"> <property name="org.apache.catalina.authenticator.jaspic.ServerAuthModule.1" value="fully.qualified.implementation.class.Name" /> <property name="see-provider-documentation" value="see-provider-documentation" /> </provider>]]></source> <p>The configuration is similar to the <code>AuthConfigProvider</code> in the previous section but with some key differences.</p> <p>The <code>className</code> attribute must be <code>org.apache.catalina.authenticator.jaspic.SimpleAuthConfigProvider</code>.</p> <p>The <code>ServerAuthModule</code>(s) are specified via properties. The property name must be <code>org.apache.catalina.authenticator.jaspic.ServerAuthModule.n</code> where <code>n</code> is the index of the module. The index must start at 1 an increment in steps of 1 until all modules are defined. The value of the property must be the fully qualified class name of the module.</p> </subsection> </section> <section name="Dynamic configuration"> <p>Jakarta Authentication modules and configuration can be packaged within a WAR file with the web application. The web application can then register the required Jakarta Authentication configuration when it starts using the standard Jakarta Authentication APIs.</p> <p>If parallel deployment is being used then dynamic configuration should not be used. The Jakarta Authentication API assumes that a context path is unique for any given host which is not the case when using parallel deployment. When using parallel deployment, static Jakarta Authentication configuration should be used. This will require that all versions of the application use the same Jakarta Authentication configuration.</p> </section> <section name="3rd party modules"> <p>This is not an exhaustive list. The Tomcat community welcomes contributions that add to this section.</p> <subsection name="Philip Green II&apos;s module for Google OAuth 2"> <p>The source code for this module along with the <a href="https://github.com/phillipgreenii/google-oauth-2.0-serverauthmodule">documentation</a> which includes details of the necessary Google API configuration is available on GitHub.</p> <p>A sample configuration for using this module with Tomcat would look like this:</p> <source><![CDATA[<jaspic-providers xmlns="https://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://tomcat.apache.org/xml jaspic-providers.xsd" version="1.0"> <provider name="google-oauth" className="org.apache.catalina.authenticator.jaspic.SimpleAuthConfigProvider" layer="HttpServlet" appContext="Catalina/localhost /contextPath" description="Google OAuth test"> <property name="org.apache.catalina.authenticator.jaspic.ServerAuthModule.1" value="com.idmworks.security.google.GoogleOAuthServerAuthModule" /> <property name="oauth.clientid" value="obtained-from-Google-console" /> <property name="oauth.clientsecret" value="obtained-from-Google-console" /> <property name="ignore_missing_login_context" value="true" /> </provider> </jaspic-providers>]]></source> </subsection> </section> </body> </document>
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
11.81
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 10 10
https://jakarta.ee/specifications/authentication/3.1/ 38 38
https://github.com/phillipgreenii/google-oauth-2.0-serverauthmodule 172 172
https://tomcat.apache.org/xml 178 178