-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamais
92 lines (76 loc) · 2.62 KB
/
amais
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
JBOSS/standalone/configuration/standalone.xml
<datasource
jndi-name="java:/mysqlDS" pool-name="my_pool"
enabled="true" jta="true"
use-java-context="true" use-ccm="true">
<connection-url>
jdbc:mysql://localhost:3306/qcon1
</connection-url>
<driver>
mysql
</driver>
<security>
<user-name>root</user-name>
<password></password>
</security>
<statement>
<prepared-statement-cache-size>
100
</prepared-statement-cache-size>
<share-prepared-statements/>
</statement>
</datasource>
JBOSS/modules/com/mysql/main/mysql-connector.....jar
JBOSS/modules/com/mysql/main/module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.17-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
Security:
standalone.xml
<security-domain name="qcon1sec" cache-type="default">
<authentication>
<login-module code="Database" flag="required">
<module-option name="dsJndiName" value="java:jboss/datasources/mysqlDS"/>
<module-option name="principalsQuery" value="select password from users where login like ?"/>
<module-option name="rolesQuery" value="select role, 'Roles' from roles where login like ?"/>
</login-module>
</authentication>
</security-domain>
jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain>java:/jaas/qcon1sec</security-domain>
</jboss-web>
web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>Url de autenticacao</web-resource-name>
<url-pattern>/adiciona.jsf</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsf</form-login-page>
<form-error-page>/login.jsf?message=login incorreto</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>*</role-name>
</security-role>
REST:
tive que criar uma classe para configurar o caminha das coisas rest "JaxRsApplication",
fora isso anotar a classe contato com @XmlRootElement, depois s— criar as coisas com as
anota›es do Jax-rs