How to use the Spring Security Core Plugin with the Neo4j GORM plugin - grails

I am trying to use the Spring Security Core plugin in a Grails project using the Neo4j GORM plugin.
As far as I can see I have two options:
Use the Spring Security Core plugin as is and persist it's data to say MySQL while using Neo4j for the rest of the application data.
Use a custom UserDetailsService.
Does anyone have an example of the latter?
pjdv

You mean like the one in the documentation? http://grails-plugins.github.com/grails-spring-security-core/docs/manual/guide/11%20Custom%20UserDetailsService.html

Since the Neo4j plugin is GORM compliant, spring-security-core's GormUserDetailsService should work out of the box.

Related

Configuring grails spring security plugin work with documentdb

Kindly help me to connect grails spring security plugin to work with DocumentDB for storing and retrieving the credentials. I am not using gorm to work with DocumentDB in my application.
According to: http://alvarosanchez.github.io/grails-spring-security-rest/latest/docs/#_token_storage
The tokens are stored on the server using a tokenStorageService bean. The plugin comes with out-of-the-box support for JWT, Memcached, GORM and Grails Cache, but you can use your own strategy implementing the TokenStorageServiceinterface.
You need to implement TokenStorageService interface to connect to DocumentDB using the Azure DocumentDB Java SDK.
Please let me know if you need help on this.

Spring data Neo4j with JSF Java application

I would like to use Spring Data Neo4j but I want use only this part of Spring. All my web application I want to build with JSF framework. I have problems to mix Spring Data Neo4j and JSF. Is it possible or is is worth to use spring data Neo4j instead of OGM Neo4j? Maybe is better to stay with simple OGM driver in my case?

difference between storing data into neo4j graph database using Java and Spring?

I'm little confuse that if my project is on Spring and I want to use neo4j with java not with Spring Data .
what is a good practice ?
Thanks
You have another options for your Java app. I assume you are talking about client application, not about extension for Neo4j.
One option is to use REST API from your application. As a client you can use Jersey client and another REST client, which you like.
Another option is to use OGM, which is Object Graph Mapping Library, like Hibernate for rdbms. https://github.com/neo4j/neo4j-ogm
OGM for Neo4j is now separated from Spring : https://github.com/neo4j/neo4j-ogm. So you don't have to use Spring Data and can still use OGM (or even stick with Core Java API if you want). But Spring Data has some nice features (i.e. repositories) so if I were you I would give it a try.
If you're using spring, best practice would probably be to use spring-data-neo4j, because its integration with the rest of spring is quite nice. That being said, of course you don't have to. You have the options listed by others, and of course you can use the native Java API.
If you've already taken the step to use spring, in general I'd recommend using spring-data-neo4j unless you have a compelling specific requirement not to.

Using spring security plugin with alternative database schema

i want to use spring security and to map my model to a simplistic database schema.
According to this: http://docs.spring.io/spring-security/site/docs/3.0.x/reference/springsecurity-single.html#db_schema_users_authorities (section user schema), i can have a that match the one i have.
Note that this schema is the basic schema of tomcat with the database realm.
But i don't know how to tell spring to which schema i use and what are the tables to use wich what fields.
If you're using the Grails Spring Security plugin you're lookingin the wrong place - you don't configure it using standard Spring Security but within the plugin itself.
This is a common enough customization that it has its own chapter in the plugin docs - see https://grails-plugins.github.io/grails-spring-security-core/guide/userDetailsService.html

How to fetch user data from LDAP with Grails?

I have a legacy Grails project that uses GormAuthorization. What I need to do is to make the app fetch some data from the LDAP server and store it in the DB.
I tried to use the spring-security-ldap plugin for that, but failed to make it work together with existing authorization method. Is there any convenient way to fetch LDAP data with Grails?
Couldn't find any suitable solution with Grails or groovy, so finally decided to stick to this Java library: https://www.unboundid.com/products/ldapsdk/.

Resources