facebook

Myeclipse for spring 10.6 scaffolding spring security

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #341686 Reply

    zackoune
    Member

    Hi,

    I have generated the spring security, it works fine, but when I enter in the database :
    ID:1
    Username: romain
    Enabled: 1
    Password: 123

    ID : 1
    Authorityname : ROLE_ADMIN

    ID_USER: 1
    ID_AUTHORITY: 1

    when I login its says to me everytime bad credentials, please help me !!

    #341687 Reply

    support-swapna
    Moderator

    zackoune,

    Sorry that you are seeing issues. The issue is not clear to me.

    1. Can you please clarify if you trying to login using the credentials you have entered in the database?

    2. If yes then you should change the default generated username and password values for <User> tag in the file <projectname>-security-context.xml which is under the Java Resources/resources accordingly. Ex : CustomersApp-security-context.xml as shown is this tutorial :
    http://www.myeclipseide.com/documentation/quickstarts/ME4STutorialScaffoldingSecurity/scaffoldingsecurityarticle.html

    3. If you are seeing a different issue, please elaborate the steps you are following or send us the sample project to help us investigate further.

    #341689 Reply

    zackoune
    Member

    yes I only generate spring security with database option, and this was the entries to populate my database, I think its because of the role or something that I didnt enter corectly

    #341690 Reply

    zackoune
    Member

    he generate this for the authentification :

    <authentication-manager alias=”authenticationManager”>

    <authentication-provider user-service-ref=”userDetailsService”>
    <password-encoder hash=”sha”/>
    </authentication-provider>
    </authentication-manager>
    <beans:bean class=”org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl” id=”userDetailsService”>
    <beans:property name=”rolePrefix” value=”ROLE_”/>
    <beans:property name=”dataSource” ref=”springSecurityDataSource”/>
    <beans:property name=”usersByUsernameQuery” value=”SELECT username,password,enabled FROM Users WHERE username = ?”/>
    <beans:property name=”authoritiesByUsernameQuery” value=”SELECT u.username, a.authorityname FROM Users u JOIN Users_Authorities ua on u.id = ua.user_id JOIN Authorities a on ua.authorities_id = a.id WHERE u.username = ?”/>
    </beans:bean>

    #341692 Reply

    zackoune
    Member

    If you can just send me a sample of entries to database, for scaffolding spring security Database option , it will be very nice, and also I want to integer further spring webservice, if you can help me on that also , thanks have a nice day :-)[/u]

    #341719 Reply

    support-swapna
    Moderator

    zackoune,

    Thank you for the details. I tried with MyEclipse Derby database and with the values you mentioned. I could login without any issues.

    Which database are you working with? Please check the .log file which is located at <workspace dir>/.metadata/.log for any errors of interest. If there are any, paste them here for us to take a look.

    Can you also try with MyEclipse Derby and see if the issue persists? Also please share the Installation Details from MyEclipse > Installation Summary > Installation Details.

    Let us know how it works for you.

    #341726 Reply

    zackoune
    Member

    Good morning swapna,

    Thanks for the reply, I tried with Derby database and its not working, in the GWT compilation I have this error and the compilation continue normaly :

    Validating units:
    Errors in ‘file:/U:/Users/aoune/Workspaces/MyEclipse%20for%20Spring%2010/TrustCenter/.apt_generated/gwt/client/managed/request/ApplicationRequestFactoryDeobfuscatorBuilder.java’
    Line 7: No source code is available for type com.google.web.bindery.requestfactory.vm.impl.Deobfuscator.Builder; did you forget to inherit a required module?
    Line 9: No source code is available for type com.google.web.bindery.requestfactory.vm.impl.OperationKey; did you forget to inherit a required module?
    Line 10: No source code is available for type com.google.web.bindery.requestfactory.vm.impl.OperationData.Builder; did you forget to inherit a required module?

    and also this .apt_generated, I configure it in the beginning after the creation of the web project, I am using Oracle 11, its not the database I think its in the configuration and also something missing me in the entries, and also when I run the application with myeclipse tomcat I have this in the console but the compilation succeed at the end :

    JdbcSupportLoader – Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException

    Thanks a lot

    #341753 Reply

    zackoune
    Member

    I use oracle 11 xe, and nothing in the log file, really I am stacked now

    #341756 Reply

    support-swapna
    Moderator

    zackoune,

    Can you please answer some more questions for us ?

    1. Which version of GWT are you working with ?
    2. Are you trying to generate Spring Security on a GWT+Spring scaffolded project ?
    3. The GWT compilation errors can be ignored as you no longer compile gwt 2.4 with -strict option if you use the request factory. Check these links :

    http://comments.gmane.org/gmane.org.google.gwt/78981
    https://groups.google.com/forum/#!msg/google-web-toolkit/h37UOiHUJFM/cMFVIpadZFAJ
    http://comments.gmane.org/gmane.org.google.gwt/71866

    4. Can you try following our tutorials and see if you can get the example project working ? The Spring security is generated on a scaffolded Spring MVC application in our tutorials.

    http://www.myeclipseide.com/documentation/quickstarts/ME4STutorialScaffoldingSecurity/scaffoldingsecurityarticle.html

    5. Attached is a GWT+Spring scaffolded project along with generated Spring Security which works at my end on MyEclipse Derby for your reference.

    6. We are unable to replicate the issue at our end. Can you please prepare a sample project which exhibits the issue and send it over to help us investigate further ?

    Attachments:
    You must be logged in to view attached files.
    #341763 Reply

    zackoune
    Member

    Can you plz give me the entries for the databse myeclipse derby, like user, authority and user_authority, so I can populate my database ?

    #341764 Reply

    zackoune
    Member

    heyy,

    thank you very much, I appreciate your help 🙂

    Its working with myeclipse derby, evrything fine, I have to test with orale again ad get to you, maybe because I was doing the scaffolded users and authorities in the domain package and they should be outside ? right ?

    #341822 Reply

    zackoune
    Member

    I found my problem, so just make a scaffold with the database Oracle xe 11 and driver JDBC 11 , then its not working, I tried with derby it works, so plz can you make a test on that and send me the project, thank you very much.

    #341825 Reply

    zackoune
    Member

    I found the prb, its not Oracle,

    Its when I choose encryption SHA it doesnt work, but with plaintext it works, I dont know why ??

    I scaffold and run and dont add or touch the code

    plz respound very fast , Thanks

    #341826 Reply

    support-swapna
    Moderator

    zackoune,

    When you have selected encryption, you should store encrypted values in the database.
    Since you have not stored an encrypted value in the database, and then trying to login using the plaintext password is resulting in a mismatch and so the login is failing.

    You should hash the password before storing in the database and then store the encrypted password in the database. During the login use the plaintext password.

    Take a look at this example :
    http://www.mkyong.com/spring-security/spring-security-password-hashing-example/
    You can follow on the same lines. Encrypt your password and store it in the database and then login using “123” when running the application.

    Let us know if you see any issues.

    #341828 Reply

    zackoune
    Member

    Can you give me an exemple in the demo project that you send me, with an ecryption with sha plz ?

Viewing 15 posts - 1 through 15 (of 20 total)
Reply To: Myeclipse for spring 10.6 scaffolding spring security

You must be logged in to post in the forum log in