[JBoss Seam] - Re: Exception with basic authentication
by alllle
I think the use case is slightly different. The way I enabled the HTTP basic auth is based on the reference doc by editing the components.xml file:
| <web:authentication-filter url-pattern="*.seam" auth-type="basic" realm="My App"/>
|
All pages are protected already with the url-pattern attribute and there is no additional changes to the pages.xml file or annotations to the class, such as "restricted".
I swapped in your changes to the application and tested again, and it is still broken. I see what is missing from your testing. In the components.xml file, I specified:
| <security:identity authenticate-method="#{myAuthenticator.authenticate}" />
|
So the "muAuthenticator.authenticate() should be invoked when you validate the username/password. But with your fix, it flagged the indentity component as logged in without invoking my authentication method.
What this mean is that my authentication logics is not used at all, and the user can enter any random string as username/password to get in the protected area.
The only thing different from what I described before is that Seam accepts any username / password and doesn't repeatedly prompt the browser for the username / password.
Another thing worth mentioning is that the hasRole() may never get called as my app does not use the "role" to authorize access yet.
Did I make myself clear? Please specify a "authenticate-method" and see if it is triggered in your test.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125625#4125625
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125625
18 years, 2 months
[Persistence, JBoss/CMP, Hibernate, Database] - avax.persistence.PersistenceException: org.hibernate.Propert
by stonebits
I have a tree-like data structure (with cycles)
Show (has many) submissions
Submissions (has one) prices and (has one) artwork
Prices (has one) Submission and (has one) artwork
(aka the price points to both the artwork and the submission)
I create a new submission/price pair in the .xhtml page
<a:commandButton id="addANewSubmission" value="Add New Submission"
| action="#{showsHome.instance.addSubmissionPrice(submissionHome.createNewPricelessSubmission(), priceHome.createNewPrice())}" reRender="ajaxSubmission"/>
which calls
| public void addSubmissionPrice(Submission newSubmission, Price newPrice) {
| this.submissions.add(newSubmission);
| newSubmission.setShows(this);
| newSubmission.addPrice(newPrice);
| }
Everything works fine if I don't have a price (which is optional) any idea on what I'm doing wrong? Any ideas would be appreciated.
BTW here's the complete error
Exception during request processing:
| Caused by javax.servlet.ServletException with message: "#{showsHome.persist}: javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: com.rdfsg.artdb_seam2.Price.submission"
|
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| etc
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125622#4125622
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125622
18 years, 2 months