protected String getBasicAuthRealmName ( WebRequest webRequest ) { SecurityMetadata securityMetadata = webRequest . getSecurityMetadata ( ) ; if ( securityMetadata != null ) { LoginConfiguration loginConfig = securityMetadata . getLoginConfiguration ( ) ; if ( loginConfig != null && loginConfig . getRealmName ( ) != null ) { return loginConfig . getRealmName ( ) ; } if ( config . getDisplayAuthenticationRealm ( ) ) { return userRegistry . getRealm ( ) ; } } String realm = "defaultRealm" ; return realm ; }
Return a realm name if it s defined in the web . xml file . If it s not defined in the web . xml and displayAuthenticationRealm is set to true then return the userRegistry realm . Otherwise return the realm as Default Realm .