networknt / light-oauth2

A fast, light and cloud native OAuth 2.0 authorization microservices based on light-4j
Apache License 2.0
313 stars 75 forks source link

docker-compose not working. #297

Closed Ekshunya-India closed 3 years ago

Ekshunya-India commented 3 years ago

Followed the documentation below https://doc.networknt.com/getting-started/light-oauth2/

After the maven clean install docker-compose does not run. Kindly have a look at this stack overflow link. https://stackoverflow.com/questions/64096572/light4j-oauth2-docker-compose-errors-saying-cannot-locate-specified-dockerfile/64096774#64096774

Need to change the docker-compose yml accordingly.

stevehu commented 3 years ago

The docker-compose in the light-oauth2 folder is for light-oauth2 developers only. If you just want to use the light-oauth2, you can start the docker containers from the compose files in the light-docker repository. Even better, if you just want to protect your application, you can use the OAuth 2.0 provider deployed to the light-portal. I am going to write a tutorial on how to use it soon. Meanwhile, please start the docker-compose-mysql from the light-docker.

Ekshunya-India commented 3 years ago

@stevehu thanks for the quick response. I actually have a requirement where i need to add in the phone number of the new customer while registering. That was the reason why i was adding in the phone number to the User model which needed me to run everything locally which led me to the discovery of the docker-compose issue. Kindly let me know if you were already aware of this i can delete this issue. Thanks.

stevehu commented 3 years ago

@Ekshunya-India The light-oauth2 is an OAuth 2.0 provider for development only these days as it is not scaling very well due to the database throughput constraint. Also, the database backend makes adding/removing fields a lot complicated. The enterprise version of OAuth 2.0 provider is based on Kafka and supports millions of concurrent users without issues. It doesn't have a phone number in the customer registration but it can be easily added. It is available for enterprise customers or small and medium customers can use our service from https://lightapi.net

Ekshunya-India commented 3 years ago

Hello @stevehu could you kindly let me know some more about this issue? "It is not scaling very well due to the database throughput constraint." The reason why i am asking is i was really impressed by the documentation of light-oAuth2 Repo and was planning to use the same in production for one of my mobile Apps. Thanks.

Ekshunya-India commented 3 years ago

@stevehu i was thinking if i could help out in anyway and thought of this. Would replacing MySql with MongoDb with Async Drivers improve the situation?

stevehu commented 3 years ago

The light-oauth2 is based on the Hazelcast in-memory data grid, so the underline database can be easily changed. However, we found that the Hazelcast is not very flexible to be deployed to Kubernetes and the sync between services is not fast enough. The new implementation is using Kafka streams with Event Sourcing and CQRS and it is scaling very well. As OAuth 2.0 is pretty complicated for most users, we think it might be better to provide the service to our users. I will start writing the document on the usage soon.

Ekshunya-India commented 3 years ago

Got it. Thanks.