Created
September 27, 2013 13:51
-
-
Save steppat/6728896 to your computer and use it in GitHub Desktop.
JAAS security domain para JBoss AS 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- no arquivo standalone-jms.xml --> | |
<security-domain name="lojaDomain" cache-type="default"> | |
<authentication> | |
<login-module code="Database" flag="required"> | |
<module-option name="dsJndiName" value="java:/livrariaDS"/> | |
<module-option name="principalsQuery" value="select password from users where user=?"/> | |
<module-option name="rolesQuery" value="select role, 'Roles' from roles where user like ?"/> | |
</login-module> | |
</authentication> | |
</security-domain> | |
--------- | |
No mysql execute: | |
use fj31; | |
create table users(user varchar(15), password varchar(40), primary key (user) ); | |
create table roles(user varchar(15), role varchar(15), primary key (user, role)); | |
INSERT INTO users VALUES ('joao', 'pass'); | |
INSERT INTO roles VALUES ('joao', 'administrador'); | |
INSERT INTO users VALUES ('maria', 'pass'); | |
INSERT INTO roles VALUES ('maria', 'cliente'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment