Giter VIP home page Giter VIP logo

Comments (6)

eikek avatar eikek commented on June 14, 2024

Hi @lauer - that error means, that when trying to reach to the user endpoint, the json is empty. So it cannot get the user name etc.

If you set this in the config:

sharry.restserver.logging.levels = {
  "sharry.restserver.oauth" = "Trace"
}

you should get more details. Your config looks good to me. Which version of keycloak are you using?

from sharry.

eikek avatar eikek commented on June 14, 2024

I just tried with my test setup and it works. I have this in my config:

  user-id-key = "preferred_username"
  user-email-key = "email"
  scope = "openid"
  client-id = "<client-id>"
  client-secret = "<secret>"

Then the keycloak config is very simple. I only created a client with redirect url set to http://localhost:9090/* (for testing).

from sharry.

lauer avatar lauer commented on June 14, 2024

Strange. I have tried minimum-level = "Trace" but it does not seems to log more (json format)
I just get a 403 red error on the sign-in page, and no actually saying error message in logfile.

{
    "level": "INFO",
    "levelValue": 300.0,
    "message": "Got user id: None",
    "additionalMessages": [],
    "fileName": "CodeFlow.scala",
    "className": "sharry.restserver.oauth.CodeFlow",
    "methodName": "resp",
    "line": 100,
    "column": null,
    "data": {},
    "traces": [],
    "timestamp": 1705312876714,
    "date": "2024-01-15",
    "time": "11:01:16.714+-1-60"
}
{
    "level": "TRACE",
    "levelValue": 100.0,
    "message": "user structure: {\"sub\":\"64a8d0c3-edb2-4a44-8fba-15345cfd797c\",\"email_verified\":true,\"name\":\"NAME\",\"preferred_username\":\"EMAIL\",\"given_name\":\"Jesper\",\"family_name\":\"LAST_NAME\",\"email\":\"EMAIL\"}",
    "additionalMessages": [],
    "fileName": "CodeFlow.scala",
    "className": "sharry.restserver.oauth.CodeFlow",
    "methodName": "resp",
    "line": 98,
    "column": null,
    "data": {},
    "traces": [],
    "timestamp": 1705312876711,
    "date": "2024-01-15",
    "time": "11:01:16.711+-1-60"
}
{
    "level": "INFO",
    "levelValue": 300.0,
    "message": "HTTP/1.1 403 Forbidden",
    "additionalMessages": [],
    "fileName": "",
    "className": "org.http4s.server.middleware.Logger",
    "methodName": null,
    "line": null,
    "column": null,
    "data": {},
    "traces": [],
    "timestamp": 1705312876811,
    "date": "2024-01-15",
    "time": "11:01:16.811+-1-60"
}

Hereafter there is a session registed at keycloak, and I get this error message when I try again

An invalid response was received from the upstream server.

from sharry.

eikek avatar eikek commented on June 14, 2024

Hm, strange 🤔 Can you perhaps try with my settings, use scope=openid and user-id-key=preferred_username? Just curious... though I think it should work with your settings as well. The response actually contains everything (the logged user-structure).

from sharry.

maximelouet avatar maximelouet commented on June 14, 2024

I am using sharry with Keycloak, and I can confirm that I had to set user-id-key = "preferred_username" to make it work.

from sharry.

github-actions avatar github-actions commented on June 14, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. This only applies to 'question' issues. Always feel free to reopen or create new issues. Thank you!

from sharry.

Related Issues (20)

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.