jdbcrealm

javax.security.auth.login.LoginException: Security Exception

一个人想着一个人 提交于 2019-12-09 07:06:51
问题 I am attempting to setup container managed security with GlassFish v3.1.2 and JSF 2.1 and primeFaces 3.4.2 The value HexValue and the database match, but get the following Exception I tried Base64 encoder but same result. The calculated value, and password are fine, something else I missed out... is there any other setting that I am missing out esp in glassfish or login.xhtml file username: admin1 pass: admin using following SHAConverter.java Used org.apache.commons.codec.digest.DigestUtils;

How to make each user access resources at a specific location according to their authority/role in JAAS?

穿精又带淫゛_ 提交于 2019-12-08 19:44:25
问题 I'm using GlassFish server 4.0 in which I have assigned different authorities/roles to different users. A user may have multiple authorities/roles. For example, an admin user may be associated with ROLE_ADMIN (to perform administrative tasks) and ROLE_USER (to perform tasks as a registered user). In my web.xml , this is configured as follows. <security-constraint> <display-name>AdminConstraint</display-name> <web-resource-collection> <web-resource-name>ROLE_ADMIN</web-resource-name>

How to configure JNDI Realm with Tomcat 7 for PKI User Certificate Authentication?

依然范特西╮ 提交于 2019-12-08 06:52:58
问题 List, I have actually searched extensively on this topic and either a) I don't know how to configure something and/or b) I don't quite understand what a JNDI Realm actually is supposed to do. I am using Tomcat 7.0.32 with jdk 1.7.0_15. Here is what I want to do. I work with customers that use PKI User Certificates. The user certificates have a cn like "Joe Smith". What I need to be able to do is look up this CN in LDAP and get the users id, which may be something like "jsmith23", and populate

how to get/set the salt for a JdbcRealm

谁说胖子不能爱 提交于 2019-12-07 12:35:15
问题 I am attempting to use the Shiro JdbcRealm and SHA256 hashedcredentialsMatcher. I need to update a legacy database and assign the appropriate salt for each user (via a batch routine). how do I get/set the salt for a given account using the Shiro framework? 回答1: With Shiro 1.2.3 all you need to do is: Extend JdbcRealm and set salt style. public class JdbcSaltRealm extends JdbcRealm { public JdbcSaltRealm() { setSaltStyle(SaltStyle.COLUMN); } } Update shiro.ini to use extended realm and to get

How to configure JNDI Realm with Tomcat 7 for PKI User Certificate Authentication?

社会主义新天地 提交于 2019-12-07 07:23:26
List, I have actually searched extensively on this topic and either a) I don't know how to configure something and/or b) I don't quite understand what a JNDI Realm actually is supposed to do. I am using Tomcat 7.0.32 with jdk 1.7.0_15. Here is what I want to do. I work with customers that use PKI User Certificates. The user certificates have a cn like "Joe Smith". What I need to be able to do is look up this CN in LDAP and get the users id, which may be something like "jsmith23", and populate the Principal user in the request header. The reason for this is I have an application deployed in

how to programatically add users to tomcat UserDatabaseRealm?

最后都变了- 提交于 2019-12-06 05:00:45
问题 I am having a simple Java web application with not more than 20-25 users who would be logged in. I am currently using tomcat server to host it and am using the UderDatabaseRealm for access control. I would like to add a feature to this application wherein the administrator can add users to the system through the application itself. I would like to know is it possible to programmatically add users to this file. One method I can think of is to open the tomcat_users.xml file within my

how to get/set the salt for a JdbcRealm

故事扮演 提交于 2019-12-06 01:53:07
I am attempting to use the Shiro JdbcRealm and SHA256 hashedcredentialsMatcher. I need to update a legacy database and assign the appropriate salt for each user (via a batch routine). how do I get/set the salt for a given account using the Shiro framework? Max With Shiro 1.2.3 all you need to do is: Extend JdbcRealm and set salt style. public class JdbcSaltRealm extends JdbcRealm { public JdbcSaltRealm() { setSaltStyle(SaltStyle.COLUMN); } } Update shiro.ini to use extended realm and to get salt column from DB credentialsMatcher = org.apache.shiro.authc.credential.HashedCredentialsMatcher

Accessing user details after logging in with Java EE Form authentication

ぐ巨炮叔叔 提交于 2019-12-05 18:48:55
I have implemented a Java EE security realm that redirects users to login.jsp if they try and access a protected resource. Say a user wants to go to a protected url - http://mywebapp/shopping_cart which is mapped to ShoppingCartServlet As they are not logged in Glassfish directs them to login.jsp They then enter their username and password and click Login and the information gets POSTed to http://mywebapp/j_security_check If they have entered the correct details they are then redirected to the servlet that handles the url http://mywebapp/shopping_cart Now I want to pull the user's details from

Password Encryption Algorithm in Glassfish 4

筅森魡賤 提交于 2019-12-05 06:51:09
I've recently updated Glassfish from 3.1.2 to 4.0 and wanted to set up a JDBCRealm that I used before on my app which uses FORM based authentication. The passwords are hashed with SHA-256 in the database (that is the default Digest Algorithm option). The realm has a property that became mandatory in this Glassfish version: Password Encryption Algorithm. Quite incredibly, the official Glassfish documentation says it's optional, and the note under the input field says it is a risk to leave it empty, however you cannot leave it empty as it is mandatory. I cannot log in in my app that was working

how to programatically add users to tomcat UserDatabaseRealm?

ⅰ亾dé卋堺 提交于 2019-12-04 09:22:19
I am having a simple Java web application with not more than 20-25 users who would be logged in. I am currently using tomcat server to host it and am using the UderDatabaseRealm for access control. I would like to add a feature to this application wherein the administrator can add users to the system through the application itself. I would like to know is it possible to programmatically add users to this file. One method I can think of is to open the tomcat_users.xml file within my application and do XML manipulation to add the users. Is there a better way than this? My realm is configured in