Realm name in tomcat (web.xml)

99封情书 提交于 2019-12-09 14:38:08

问题


What is the realm-name in the tomcat.

<login-config> 
     <auth-method>BASIC</auth-method> 
     <realm-name></realm-name> 
</login-config>

In the above code I have to fill the realm-name element. I have seen the following code in the server.xml file:

<Realm className="org.apache.catalina.realm.UserDatabaseRealm" 
            resourceName="UserDatabase"/>

Where is the realm-name specified? Is it the user name?


回答1:


Realm name is not the user name. It is the authentication realm, 'typically a description of the computer or system being accessed" - see http://en.wikipedia.org/wiki/Basic_access_authentication. This should be name that makes sense for the resource you are protecting.




回答2:


The value <realm-name> element is used to calculate the digested value of a cleartext password, as described here http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#Digested_Passwords

If <realm-name> element is not specified in web.xml, the default value of "Authentication required" is used.



来源:https://stackoverflow.com/questions/10892336/realm-name-in-tomcat-web-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!