blob: 087b07ebaa9bfff63a258fe9ae4381605e024fd9 [file] [log] [blame]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 1.8.1 at 2020-10-28
| Rendered using Apache Maven Fluido Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="Date-Revision-yyyymmdd" content="20201028" />
<meta http-equiv="Content-Language" content="en" />
<title>Apache Shiro :: Web &#x2013; CPD Results</title>
<link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" />
<link rel="stylesheet" href="./css/site.css" />
<link rel="stylesheet" href="./css/print.css" media="print" />
<script type="text/javascript" src="./js/apache-maven-fluido-1.5.min.js"></script>
</head>
<body class="topBarDisabled">
<div class="container-fluid">
<div id="banner">
<div class="pull-left">
<a href="http://shiro.apache.org" id="bannerLeft">
<img src="http://shiro.apache.org/images/apache-shiro-logo.png" alt="Shiro"/>
</a>
</div>
<div class="pull-right"> <div id="bannerRight">
<img src="http://shiro.apache.org/images/asf_logo.png" />
</div>
</div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li class="">
<a href="../index.html" title="Apache Shiro :: Web">
Apache Shiro :: Web</a>
<span class="divider">/</span>
</li>
<li class="">
<a href="index.html" title="Apache Shiro :: Web">
Apache Shiro :: Web</a>
<span class="divider">/</span>
</li>
<li class="active ">CPD Results</li>
<li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2020-10-28</li>
<li id="projectVersion" class="pull-right">
Version: 1.7.0
</li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Parent Project</li>
<li>
<a href="../index.html" title="Apache Shiro">
<span class="none"></span>
Apache Shiro</a>
</li>
<li class="nav-header">Project Documentation</li>
<li>
<a href="project-info.html" title="Project Information">
<span class="icon-chevron-right"></span>
Project Information</a>
</li>
<li>
<a href="project-reports.html" title="Project Reports">
<span class="icon-chevron-down"></span>
Project Reports</a>
<ul class="nav nav-list">
<li>
<a href="apidocs/index.html" title="Javadoc">
<span class="none"></span>
Javadoc</a>
</li>
<li>
<a href="xref/index.html" title="Source Xref">
<span class="none"></span>
Source Xref</a>
</li>
<li>
<a href="xref-test/index.html" title="Test Source Xref">
<span class="none"></span>
Test Source Xref</a>
</li>
<li class="active">
<a href="#"><span class="none"></span>CPD</a>
</li>
<li>
<a href="pmd.html" title="PMD">
<span class="none"></span>
PMD</a>
</li>
<li>
<a href="surefire-report.html" title="Surefire Report">
<span class="none"></span>
Surefire Report</a>
</li>
<li>
<a href="taglist.html" title="Tag List">
<span class="none"></span>
Tag List</a>
</li>
<li>
<a href="jdepend-report.html" title="JDepend">
<span class="none"></span>
JDepend</a>
</li>
<li>
<a href="dashboard-report.html" title="DashBoard Report">
<span class="none"></span>
DashBoard Report</a>
</li>
</ul>
</li>
</ul>
<hr />
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</div>
</div>
</div>
<div id="bodyColumn" class="span10" >
<div class="section">
<h2><a name="CPD_Results"></a>CPD Results</h2>
<p>The following document contains the results of PMD's <a class="externalLink" href="https://pmd.github.io/latest/pmd_userdocs_cpd.html">CPD</a> 6.13.0.</p></div>
<div class="section">
<h2><a name="Duplications"></a>Duplications</h2>
<table border="0" class="table table-striped">
<tr class="a">
<th>File</th>
<th>Line</th></tr>
<tr class="b">
<td>org/apache/shiro/web/filter/authc/BasicHttpAuthenticationFilter.java</td>
<td><a href="./xref/org/apache/shiro/web/filter/authc/BasicHttpAuthenticationFilter.html#L75">75</a></td></tr>
<tr class="a">
<td>org/apache/shiro/web/filter/authc/HttpAuthenticationFilter.java</td>
<td><a href="./xref/org/apache/shiro/web/filter/authc/HttpAuthenticationFilter.html#L320">320</a></td></tr>
<tr class="b"><td colspan='2'>
<div>
<pre> }
/**
* Creates an AuthenticationToken for use during login attempt with the provided credentials in the http header.
* &lt;p/&gt;
* This implementation:
* &lt;ol&gt;&lt;li&gt;acquires the username and password based on the request's
* {@link #getAuthzHeader(javax.servlet.ServletRequest) authorization header} via the
* {@link #getPrincipalsAndCredentials(String, javax.servlet.ServletRequest) getPrincipalsAndCredentials} method&lt;/li&gt;
* &lt;li&gt;The return value of that method is converted to an &lt;code&gt;AuthenticationToken&lt;/code&gt; via the
* {@link #createToken(String, String, javax.servlet.ServletRequest, javax.servlet.ServletResponse) createToken} method&lt;/li&gt;
* &lt;li&gt;The created &lt;code&gt;AuthenticationToken&lt;/code&gt; is returned.&lt;/li&gt;
* &lt;/ol&gt;
*
* @param request incoming ServletRequest
* @param response outgoing ServletResponse
* @return the AuthenticationToken used to execute the login attempt
*/
protected AuthenticationToken createToken(ServletRequest request, ServletResponse response) {
String authorizationHeader = getAuthzHeader(request);
if (authorizationHeader == null || authorizationHeader.length() == 0) {
// Create an empty authentication token since there is no
// Authorization header.
return createToken(&quot;&quot;, &quot;&quot;, request, response);
}
log.debug(&quot;Attempting to execute login with auth header&quot;);
String[] prinCred = getPrincipalsAndCredentials(authorizationHeader, request);
if (prinCred == null || prinCred.length &lt; 2) {
// Create an authentication token with an empty password,
// since one hasn't been provided in the request.
String username = prinCred == null || prinCred.length == 0 ? &quot;&quot; : prinCred[0];
return createToken(username, &quot;&quot;, request, response);
}
String username = prinCred[0];
String password = prinCred[1];
return createToken(username, password, request, response);
}
/**
* Returns the username and password pair based on the specified &lt;code&gt;encoded&lt;/code&gt; String obtained from
* the request's authorization header.
* &lt;p/&gt;
* Per RFC 2617, the default implementation first Base64 decodes the string and then splits the resulting decoded
* string into two based on the &quot;:&quot; character. That is:
* &lt;p/&gt;
* &lt;code&gt;String decoded = Base64.decodeToString(encoded);&lt;br/&gt;
* return decoded.split(&quot;:&quot;);&lt;/code&gt;
*
* @param scheme the {@link #getAuthcScheme() authcScheme} found in the request
* {@link #getAuthzHeader(javax.servlet.ServletRequest) authzHeader}. It is ignored by this implementation,
* but available to overriding implementations should they find it useful.
* @param encoded the Base64-encoded username:password value found after the scheme in the header
* @return the username (index 0)/password (index 1) pair obtained from the encoded header data.
*/
protected String[] getPrincipalsAndCredentials(String scheme, String encoded) {</pre></div></td></tr></table></div>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row-fluid">
<p >Copyright &copy; 2004&#x2013;2020
<a href="https://www.apache.org/">The Apache Software Foundation</a>.
All rights reserved.
</p>
</div>
</div>
</footer>
</body>
</html>