Code Monkey home page Code Monkey logo

Comments (13)

caelcs avatar caelcs commented on May 18, 2024

Well no much to do... just need two things... annotate your Main Spring Boot application class and then make sure that you have the properties required.

You can have a look to this integration test to see how it works.

https://github.com/caelwinner/spring-security-mongo/blob/master/src/test/java/uk/co/caeldev/springsecuritymongo/MongoClientDetailsServiceIntegrationTest.java

from spring-security-mongo.

caelcs avatar caelcs commented on May 18, 2024

and one more thing, this library provides you all the beans that you may need to configure your different repositories like store, client credentials etc.
If you want to know how to configure the Spring OAuth2 using this library you can look at the project in my oath2-server and have a look to the spring oauth2 doc.

from spring-security-mongo.

Repulser avatar Repulser commented on May 18, 2024

By looking at the Oauth 2 server code, it seems that MongoTokenStore should be a bean?
Though Ive added the @EnableMongoSecurity annotation and still get
Parameter 1 of constructor in catalogue.mobile.AuthorizationServerConfig required a bean of type 'uk.co.caeldev.springsecuritymongo.MongoTokenStore' that could not be found.

from spring-security-mongo.

caelcs avatar caelcs commented on May 18, 2024

from spring-security-mongo.

Repulser avatar Repulser commented on May 18, 2024

That was it!! thanks a lot, I added them and everything started working, one last question: is there a way to use my own mongo client and authenticate on my own?

from spring-security-mongo.

caelcs avatar caelcs commented on May 18, 2024

from spring-security-mongo.

caelcs avatar caelcs commented on May 18, 2024

you can always override the mongo client provided by defining your own and using the @primary annotation 👍

from spring-security-mongo.

Repulser avatar Repulser commented on May 18, 2024

I meant authenticating with mongo, the @Primary worked perfectly, thanks! though theres still the need to define the properties, is there a way to avoid this or should i just pseudo-define them?

from spring-security-mongo.

caelcs avatar caelcs commented on May 18, 2024

from spring-security-mongo.

caelcs avatar caelcs commented on May 18, 2024

from spring-security-mongo.

caelcs avatar caelcs commented on May 18, 2024

from spring-security-mongo.

Repulser avatar Repulser commented on May 18, 2024

Nothing really, im just using mongo for other things and would like to share the client, aswell as using different methods of authentication....
Removing the requirement for the properties would be nice, though ill just fill them with randomness for now.

from spring-security-mongo.

caelcs avatar caelcs commented on May 18, 2024

I have release version 2.0.0 adding only the Mongo Client when the properties has been set. Can I close this issue?

from spring-security-mongo.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.