Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic / 502 Bad Gateway in authenticated webfinger #6102

Closed
kulmann opened this issue Apr 20, 2023 · 1 comment
Closed

panic / 502 Bad Gateway in authenticated webfinger #6102

kulmann opened this issue Apr 20, 2023 · 1 comment
Labels
Priority:p1-urgent Consider a hotfix release with only that fix Type:Bug

Comments

@kulmann
Copy link
Member

kulmann commented Apr 20, 2023

Describe the bug

An authenticated request to .well-known/webfinger where the webfinger service runs as part of ocis (I did not test standalone) causes a panic in the Oidc middleware.

Steps to reproduce

Steps to reproduce the behavior:

  1. Start e.g. oCIS single binary or keycloak deployment example (= webfinger service running alongside ocis)
  2. Obtain an access token
  3. Use the access token to make an authenticated request to .well-known/webfinger?resource=<issuerUrl>

Expected behavior

Webfinger service behaves as documented in https://owncloud.dev/services/webfinger/ - i.e. gives a response including the ocis instances the user has access to.

Actual behavior

Request terminates with a 502 Bad Gateway.

Setup

Single binary or keycloak deployment example

Initial findings

Running ocis with a debugger I found out that there is a panic happening in the oidc middleware:
http: panic serving 127.0.0.1:48434: runtime error: invalid memory address or nil pointer dereference

Set a breakpoint here:

return goidc.NewProvider(

and step into NewProvider. The doRequest call will run into a CertificateVerificationError for an ocis with self signed certificate. Unfortunately I don't know how to make use of OCIS_INSECURE=true here....

The error then gets swallowed into nirvana here:

Finally running into a nil dereference here:

userInfo, err := provider.UserInfo(

when calling provider.UserInfo.

@kulmann kulmann added Type:Bug Priority:p1-urgent Consider a hotfix release with only that fix labels Apr 20, 2023
@dragonchaser
Copy link
Member

It seems like, when using an internal IDP querying the oidc .well-knows an error gets thrown, resulting in an empty in

provider, err = providerFunc()
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p1-urgent Consider a hotfix release with only that fix Type:Bug
Projects
Archived in project
Development

No branches or pull requests

3 participants