Giter VIP home page Giter VIP logo

go-kratos-test's People

Contributors

atreya2011 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-kratos-test's Issues

Setup

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

Issue following the 2nd step in the README.md

first step:

docker-compose up -d --build

second step:

curl -X POST 'http://localhost:4445/clients' \
-H 'Content-Type: application/json' \
--data-raw '{
  "client_id": "auth-code-client",
  "client_name": "Test OAuth2 Client",
  "client_secret": "secret",
  "grant_types": ["authorization_code", "refresh_token"],
  "redirect_uris": ["http://localhost:4455/dashboard"],
  "response_types": ["code", "id_token"],
  "scope": "openid offline",
  "token_endpoint_auth_method": "client_secret_post",
  "metadata": {"registration": true, "consent": true}
}'

<< this step fails with

curl: (7) Failed to connect to localhost port 4445 after 6 ms: Connection refused

I think the port in the 2nd step is incorrect. Should it not be 4455?
Changing the command to use 4455, it renders no response. Maybe that is the correct, expected way.

Implementation of Kratos + Hydra have problems.

Hello atreya2011

First of all, thank you for your work, it's very nice to have such example.

I tried your implementation Kratos + Hydra, from branch hydra, but I faced two problem, and for one I have solution.

My ENV:

OS Debian 10
Docker 20.03
I'm running here your implementation and then from other PC reaching this resource.

Problems

  1. Problem Hydra do not starting.
{"audience":"application","error":{"message":"ERROR: relation \"hydra_jwk\" does not exist (SQLSTATE 42P01)"},"level":"fatal","msg":"Could not ensure that signing keys for \"hydra.openid.id-token\" exists. If you are running against a persistent SQL database this is most likely because your \"secrets.system\" (\"SECRETS_SYSTEM\" environment variable) is not set or changed. When running with an SQL database backend you need to make sure that the secret is set and stays the same, unless when doing key rotation. This may also happen when you forget to run \"hydra migrate sql\"..","service_name":"ORY Hydra","service_version":"v1.10.6","time":"2021-11-28T16:49:37Z"}

I have new ENV SECRETS_SYSTEM to docker-compose.yml file, like this, for hydra-migrate and hydra

environment:
      - SECRETS_SYSTEM=some_test_secret_change_me

length of this secret must be >16

  1. Login end with an error
[PUT /oauth2/auth/requests/login/accept][400] acceptLoginRequestBadRequest  &{Error:invalid_request ErrorDebug: ErrorDescription:The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Query parameter 'challenge' is not defined but should have been. StatusCode:0}

How to repeat:

  • create a new user
  • login
  • get an error

For this one I can't say what need todo to fix it.

Can you please help with it?

Thank you.

Path /oauth2/auth/requests/login returns 404

Hi, i'm stuck here for quite some time with a problem you might have encountered:
The call to the hydra public endpoint at path /oauth2/auth/requests/login fails with a 404 Error returned in html format.

EDIT: in code this is returned, i guess the response format is determined by request headers:

{
  "error": {
     "code": 404,
     "message": "Not Found",
     "reason": "The requested route does not exist. Make sure you are using the right path, domain, and port."
  }
}

This is happening at this code branch (in the hydra-consent branch):

go-kratos-test/main.go

Lines 222 to 228 in d814b51

if flowID == "" {
loginRes, _, err := s.HydraAPIClient.AdminApi.GetLoginRequest(r.Context()).LoginChallenge(challenge).Execute()
if err != nil {
log.Error(err)
writeError(w, http.StatusUnauthorized, errors.New("Unauthorized OAuth Client"))
return
}

Perhaps you encountered this before?

Jump in flow of diagram

Your diagram was helpful to see the flow between the browser, Kratos, and Hydra.

There is a jump in the flow as highlighted in the attachment. Was that intentional?

Screenshot_20240312_155138_Brave

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.