Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Wrong response code when not logged in #52

Open
mocenas opened this issue Feb 26, 2018 · 13 comments
Open

Wrong response code when not logged in #52

mocenas opened this issue Feb 26, 2018 · 13 comments

Comments

@mocenas
Copy link

mocenas commented Feb 26, 2018

If user invokes the greeting service and is not logged in, the service should return code 401 (Unauthenticated) instead it returns 403 (access denied).

@lholmquist
Copy link
Contributor

The booster itself doesn't specify any codes, it is returning whatever keycloak is returning

@mocenas
Copy link
Author

mocenas commented Feb 27, 2018

OK so should I report it to docs to change it, or can it be fixed in the booster?

@lholmquist
Copy link
Contributor

perhaps the docs. have you tried the other runtimes SSO booster, like vert.x or swarm. what are they returning. its been a while since i did those

@mocenas
Copy link
Author

mocenas commented Feb 27, 2018

I tried a spingboot booster, which returns 401 - behaves correctly

@lholmquist
Copy link
Contributor

ok, i'll try it out. could be the keycloak-connect adapter?

are you using curl or the web page to test ?

@mocenas
Copy link
Author

mocenas commented Feb 27, 2018

I found this bug during manual testing though web page. But with curl there is same problem.

@mocenas
Copy link
Author

mocenas commented Feb 27, 2018

And from my perspective, keycloak-connect adapter is good.

@lholmquist
Copy link
Contributor

seeing the same thing. i'll see if i can track down what is going on

@lholmquist
Copy link
Contributor

This is the code that is run the very first time a request comes in for the /api/greeting before a login happens

https://github.com/keycloak/keycloak-nodejs-connect/blob/master/index.js#L233

according to the comments "... or has failed to authenticate at all ..." makes it seem like the resulting 403 is ok here.

i'll have to check with the keycloak team here

@akoniar
Copy link

akoniar commented Mar 6, 2018

I already create a pull request for it:
#60

@lholmquist
Copy link
Contributor

It was a bug in keycloak-connect, filed the JIRA, https://issues.jboss.org/browse/KEYCLOAK-6810

@lance
Copy link

lance commented Sep 19, 2018

@abstractj it appears this PR was closed but not merged. Any update on this?

@abstractj
Copy link

@lance the PR was closed because integration tests were failing and but unfortunately I didn't have enough time to fix them.

@lholmquist lholmquist added this to Stalled in Starter Apps Jul 19, 2019
@lholmquist lholmquist removed this from Stalled in Starter Apps Sep 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants