atreya2011 / go-kratos-test

MIT License
66 stars 27 forks source link

Setup #2

Closed schreddies closed 5 months ago

schreddies commented 2 years ago

Hi, Thank you so much for this code, it will make my life easier. May I ask you for some instruction for deployment instruction. docker-compose up seems not working

atreya2011 commented 2 years ago

Hello, I will try updating the README with the instructions within the next few days. In the meantime, the following are instructions for deployment. Let me know if it works for you.

Also, I have posted solutions to some common unresolved issues over here :) https://github.com/atreya2011/go-kratos-test/issues/1#issuecomment-982336976

There are 4 branches at the moment:

To try out the kratos only implementation, you need to have Docker installed and then do the following:

  1. Clone the repository locally.
  2. Run docker-compose up --build in one terminal session
  3. Then in your browser, open, http://localhost:4455/login

To try out the reference kratos + hydra implementation, you need to have

And then do the following:

  1. Clone the repository locally.

  2. git checkout hydra-consent

  3. Run docker-compose up --build in one terminal session (in case hydra fails to startup, run docker-compose down and docker-compose up --build again)

  4. In yet another terminal session, create an OAuth2 Client

docker-compose exec hydra \
    hydra clients create \
    --endpoint http://127.0.0.1:4445 \
    --id auth-code-client \
    --secret secret \
    --grant-types authorization_code,refresh_token \
    --response-types code,id_token \
    --scope openid,offline \
    --callbacks http://127.0.0.1:5555/callback
  1. And perform an OAuth2 Authorize Code Flow
docker-compose exec hydra \
    hydra token user \
    --client-id auth-code-client \
    --client-secret secret \
    --endpoint http://127.0.0.1:4444/ \
    --port 5555 \
    --scope openid,offline

I still have to address the following issues:

schreddies commented 2 years ago

@atreya2011 thank you a lot! I am interested in making the hydra as the Authorization Server, because it seems to address my idea of making oidc with API, am I right? So hydra branch?

atreya2011 commented 2 years ago

Ah I see, you can try checking out the hydra-consent branch instead of the hydra branch. And let me know if you are facing any issues.

atreya2011 commented 2 years ago

@schreddies Were you able to set up and try out the hydra-consent branch? Let me know if you are having an issues 🙏🏼