What is the UsersConnectionRepository for in Spring Social Facebook? - facebook

I'm following the directions here and elsewhere:
https://github.com/SpringSource/spring-social/wiki/Quick-Start
Why do we need to specify a dataSource and UsersConnectionRepository to use Spring Social Facebook? What gets written to our database? Am I supposed to create special tables or modify my Users table?

Yep from the docs ~ For convenience is bootstrapping the schema from a running application, this schema definition is available in the spring-social-core module as a resource at the path /org/springframework/social/connect/jdbc/JdbcUsersConnectionRepository.sql.
From here
http://static.springsource.org/spring-social/docs/1.0.x/reference/html/serviceprovider.html
You might want to take a look at the sample apps here

Related

How to create a hibernate view of other databases?

Good Morning, I'm in a problem!
My project is multitenant, I use SPRING JPA + SPRINGBOOT + POSTGRES.
Where it contains a database manager and Each tenant has its own database.
The problem starts when inside the database of the tenant I have views of the data manager database.
For example, inside the database manager I have information to make the login of the users of a tenant. But in the database of each tenant should be able to have the information of their users. Where users within the tenant database could have more data!
What is the best way to do this? Should I create the view?
In addition, this application is very popular, so the idea is that the use of the database is quite dynamic.
Thank you in advance! any contribution will be helpful.
Yes the best solution will be to create views where you get all the data that you need and the data is already filtered for the tenant.
Edit:
You have to create the views on the database and then map it to read only Entities or just use it with SQL.
To have read only entities you can use Hibernates #Immutable annotation.
Please find more information in the Hibernate documentation: https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#entity-immutability

What is the convention for creating applications users in MongoDB?

I am trying to create a users model for my application sign in with Mongoose / MongoDB. Based on how I see it when I deploy to Atlas or Mlab, it auto generates a users collection but for the purpose of database authentication - like this user has read access, write access, admin, etc. What is the convention for creating application users? Do I also use the same users collection but add additional schema properties or do I make a different one altogether like app_users. Thanks!
Are you using the test or admin database? You should create a new database for your application. When you create a new database it will not come with any predefined collections or such, so you can start blank (which is what I assume you want?).
You don't need to explicitly create a new database. Just point your driver to a database name you want for your app. Or in the mongo CLI type use myAppDb and you can start adding collections there.
More details here https://docs.mongodb.com/manual/mongo/#working-with-the-mongo-shell

how to use one table in two applications in GORM

i have created two applications in grails under single database now i want to use single table in both applications
eg. from one application admin will create the user login credentials
and from other application user should login using the same table. How can i solve this problem??
Domain class must be shared in both applications to achieve that and be able to use GORM. You can create plugin with common domain classes and use it in both applications. We have it working in both Grails 2.x and 3.x
Just use the same database configuration for both applications.
And if you want to run both at the same time, just run them in different ports
For more information see this post

Multi tenant application in grails with shared DB Separate schema can any one provide any demo app or any good reference for that

I have to make a web application multi-tenant enabled using Shared database separate schema approach. Application is built using Grails and PostgreSQL .
I need to have one single app server using a shared database with multiple schema, each schema per client.
What is the best implementation approach to achieve this? - What needs to be done at the middle tier(app-server) level? - Do I need to have multiple host headers each per client? - How can I connect to the correct schema dynamically based on the client who is accessing the application?
Any links or pointers would be helpful.

ASP.NET MVC 2: Authentication with custom SQL Database?

I'm looking into how to integrate [Authorize] within my MVC 2 application... I'm reading articles about it and I've run the aspnet_regsql tool. I see that my database now containes a bunch of new tables and a whole hell of a lot of SPROCs.
Why is all of this necessary? I thought that I would be able to check login credentials in a table that I've already created for Party ... can't I just call a SPROC that checks the login credentials and then logs the user in? Why all of these new tables and SPROCs?
Because it is the way how it is works. If you using ASP.NET Membership by default you need to have database aspnetdb with lots of tables and stored procs. If you want you may customize that. In order to do that you need to implement custom membership provider.
The simple example how to do that you may find here http://msdn.microsoft.com/en-us/library/aa479048.aspx and here http://www.asp.net/general/videos/how-do-i-create-a-custom-membership-provider also source code available.
It sounds like you want to create a custom membership provider. For logging in I think you really only need to override the ValidateUser method:
http://msdn.microsoft.com/en-us/library/f1kyba5e.aspx
For roles you may be able to get by with overriding only the IsUserInRole method:
http://msdn.microsoft.com/en-us/library/8fw7xh74.aspx