Membrane API Gateway returns 500 Internal Server Error from the userinfo endpoint of the oauth2authserver plugin when that endpoint throws an unexpected exception while it handles a request.
The response contains the status 500 Internal Server Error and the problem type https://membrane-api.io/problems/internal. The type internal means that the gateway could not complete the processing of the message. The endpoint always hides the details, so the title reads Internal Server Error, and the response contains neither an error message nor a link to this page, even in development mode. You find the link to this page in the gateway log.
Clients call <basePath>/oauth2/userinfo with an access token and get the claims of the logged-in user as JSON. A missing, malformed or unknown access token does not lead to this 500: it gets a 400 or 401 with a WWW-Authenticate error.
The endpoint parses the query string and the form body strictly, as the token endpoint does. A repeated parameter or a malformed percent-escape makes parsing fail.
The request URI cannot be parsed, or the request body cannot be read or decoded.
The session still knows the access token, but the token generator can no longer resolve it. This can presumably happen when the token is revoked while the request is running. This cause has not been reproduced, so treat it as one possibility among others.
Writing the user's claims as JSON failed. This indicates a bug in Membrane.
Authorization: Bearer <token> header, without repeated or badly encoded parameters.error level and shows which cause applies.The userinfo endpoint always answers as if the gateway were running in production mode. Setting or removing production: true in the configuration does not change this response: the client gets neither the details nor the link to this page. Membrane writes the full error, including the stack trace, to the gateway log at error level. That log entry is the place to start.
Configuration reference:
Tutorials with runnable examples:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.