| <!DOCTYPE html> |
| <!-- |
| | Generated by Apache Maven Doxia Site Renderer 1.11.1 at 2022-11-18 |
| | 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="20221118" /> |
| <meta http-equiv="Content-Language" content="en" /> |
| <title>Apache Shiro :: Core – 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 :: Core"> |
| Apache Shiro :: Core</a> |
| <span class="divider">/</span> |
| </li> |
| <li class=""> |
| <a href="index.html" title="Apache Shiro :: Core"> |
| Apache Shiro :: Core</a> |
| <span class="divider">/</span> |
| </li> |
| <li class="active ">CPD Results</li> |
| |
| |
| <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2022-11-18</li> |
| <li id="projectVersion" class="pull-right"> |
| Version: 1.10.1 |
| </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 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" > |
| |
| <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.49.0.</p></section><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/realm/ldap/DefaultLdapContextFactory.java</td> |
| <td><a href="./xref/org/apache/shiro/realm/ldap/DefaultLdapContextFactory.html#L291">291</a></td></tr> |
| <tr class="a"> |
| <td>org/apache/shiro/realm/ldap/JndiLdapContextFactory.java</td> |
| <td><a href="./xref/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#L523">523</a></td></tr> |
| <tr class="b"><td colspan='2'> |
| <div> |
| <pre>private void validateAuthenticationInfo(Hashtable<String, Object> environment) |
| throws AuthenticationException |
| { |
| // validate when using Simple auth both principal and credentials are set |
| if(SIMPLE_AUTHENTICATION_MECHANISM_NAME.equals(environment.get(Context.SECURITY_AUTHENTICATION))) { |
| |
| // only validate credentials if we have a non-empty principal |
| if( environment.get(Context.SECURITY_PRINCIPAL) != null && |
| StringUtils.hasText( String.valueOf( environment.get(Context.SECURITY_PRINCIPAL) ))) { |
| |
| Object credentials = environment.get(Context.SECURITY_CREDENTIALS); |
| |
| // from the FAQ, we need to check for empty credentials: |
| // http://docs.oracle.com/javase/tutorial/jndi/ldap/faq.html |
| if( credentials == null || |
| (credentials instanceof byte[] && ((byte[])credentials).length <= 0) || // empty byte[] |
| (credentials instanceof char[] && ((char[])credentials).length <= 0) || // empty char[] |
| (String.class.isInstance(credentials) && !StringUtils.hasText(String.valueOf(credentials)))) { |
| |
| throw new javax.naming.AuthenticationException("LDAP Simple authentication requires both a " |
| + "principal and credentials."); |
| } |
| } |
| } |
| } |
| |
| }</pre></div></td></tr></table></section> |
| </div> |
| </div> |
| </div> |
| |
| <hr/> |
| |
| <footer> |
| <div class="container-fluid"> |
| <div class="row-fluid"> |
| <p >Copyright © 2004–2022 |
| <a href="https://www.apache.org/">The Apache Software Foundation</a>. |
| All rights reserved. |
| </p> |
| </div> |
| |
| |
| </div> |
| </footer> |
| </body> |
| </html> |