spring-attic / spring-security-javaconfig

Spring Security Java Configuration Support (to be merged with spring-security-config)
175 stars 121 forks source link

Create Quickstart #123

Closed rwinch closed 11 years ago

rwinch commented 11 years ago

Should include all steps to have an XML free application with Spring Security

geine commented 11 years ago

hello, i'm a newbie with Spring Security. i've an example written well in xml, and i'm going to ignore it, translate the xml syntax into java, but i got stuck with SecurityConfiguration. i'm trying to use your sample with jdbc but it failed, i still get stuck. i've three table, one is user, role, and user_role which content with user_id and role_id, then implement user entity to userdetails which from spring, then using ShaPasswordEncoder to encode password, and salt. i've link for my xml code, here it is https://gist.github.com/geine/5794359.i hope you'll give me some light about it. thanks

rwinch commented 11 years ago

I think I will need a bit more details on how you are getting stuck. What do you mean by it failed? Does the configuration fail to load? If so, what exception do you get? What does your Java Configuration look like? The gist you provided does not provide any details about the content of com.rscharitas.training.spring.web.jpa.hibernate.security. In short, I need something more concrete in order to help you.

geine commented 11 years ago

hello Rob, i've tried to translate that xml syntax into java class, everytime i run the application, it is said, Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/WebSecurityConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.security.web.FilterChainProxy org.springframework.security.config.annotation.web.WebSecurityConfiguration.springSecurityFilterChain() throws java.lang.Exception] threw exception; nested exception is org.springframework.dao.DataAccessResourceFailureException: Failed to execute database script; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement at line 1 of resource class path resource [org/springframework/security/core/userdetails/jdbc/users.ddl]: create table users(username varchar_ignorecase(50) not null primary key,password varchar_ignorecase(50) not null,enabled boolean not null).

here is the link for SecurityConfiguration i made. https://gist.github.com/geine/570be44d6bdac5e35f42. and the link for mainConfiguration is here, https://gist.github.com/geine/3044f9ad2f95051421c8. i create user implements from userdetails, that's why i used salt, passwordencoder in securityConfiguration. there is not much talking about securityConfiguration, please help me, where i do wrong, please correct it. thanks

2013/6/17 Rob Winch notifications@github.com

I think I will need a bit more details on how you are getting stuck. What do you mean by it failed? Does the configuration fail to load? If so, what exception do you get? What does your Java Configuration look like? The gist you provided does not provide any details about the content of com.rscharitas.training.spring.web.jpa.hibernate.security. In short, I need something more concrete in order to help you.

— Reply to this email directly or view it on GitHubhttps://github.com/SpringSource/spring-security-javaconfig/issues/123#issuecomment-19558505 .

rwinch commented 11 years ago

Does the user have permissions to create the schema? Does the schema already exist? If so this can cause failures.

geine commented 11 years ago

yes, i got all confused with springsecurity configuration, if you have any tutorial, can you send me one? because there'll be many things i should to modified from your source and i have a little idea, eventually, it is very little talk in web about springsecurity config, many of programmer just using xml and i hate to have my code mingle with xml when they all clear of xml before. thanks

2013/6/18 Rob Winch notifications@github.com

Does the user have permissions to create the schema? Does the schema already exist? If so this can cause failures.

— Reply to this email directly or view it on GitHubhttps://github.com/SpringSource/spring-security-javaconfig/issues/123#issuecomment-19617555 .

rwinch commented 11 years ago

Did you figure out the issue? I'm not sure what you were saying yes to. Yes the user had permissions or Yes the schema was already created? If you did solve this issue, please close this issue out.

The only documentation that currently exists is on the github main page. There will be more documentation to come, but as the code has been under rather active development with non-passive changes (it hasn't yet been released) it doesn't make sense to commit a lot of time to detailed tutorials yet. A milestone release and further documentation should be coming soon.

For now, I would look through the tests that demonstrate how to convert from XML to Java Config (see the README for details on this). If this does not help, please create a new issue with a specific XML configuration with a specific error and complete stacktrace (please use markdown to format the code and stacktrace so it is easier to read).

geine commented 11 years ago

actually, i still can't figure it out. at the end i'm using xml and it run well.

2013/6/19 Rob Winch notifications@github.com

Did you figure out the issue? I'm not sure what you were saying yes to. Yes the user had permissions or Yes the schema was already created? If you did solve this issue, please close this issue out.

The only documentation that currently exists is on the github main page. There will be more documentation to come, but as the code has been under rather active development with non-passive changes (it hasn't yet been released) it doesn't make sense to commit a lot of time to detailed tutorials yet. A milestone release and further documentation should be coming soon.

For now, I would look through the tests that demonstrate how to convert from XML to Java Config (see the README for details on this). If this does not help, please create a new issue with a specific XML configuration with a specific error and complete stacktrace (please use markdownhttp://github.github.com/github-flavored-markdown/to format the code and stacktrace so it is easier to read).

— Reply to this email directly or view it on GitHubhttps://github.com/SpringSource/spring-security-javaconfig/issues/123#issuecomment-19660005 .

rwinch commented 11 years ago

Please open another ticket if you can provide details around the issue you are having.