JsonRPC response and external OAuth2 server

23 views
Skip to first unread message

Oleksandr Oliinyk

unread,
May 11, 2021, 3:52:14 AM5/11/21
to Fusio
Hi there!
1. Is it possible to redefine the logic of the answer "jsonrpc"? Now it is possible to generate only a successful response, and we also need to return errors with custom codes.

2. Is it possible to redefine oauth2 logic to use an external authorization server?

Christoph Kappestein

unread,
May 11, 2021, 3:34:56 PM5/11/21
to Fusio
Hi,

yes so you could directly throw a PSX\Json\Rpc\Exception\ServerErrorException in your action where you can define a custom error code. But this is then only useful if you invoke your action via JsonRPC.
You can also throw a PSX\Http\Exception\StatusCodeException where the HTTP status code gets used as error code and it works for both RPC and REST calls.

Regarding OAuth2 currently it is not possible to use a different OAuth2 server since all App/Scope Token handling is deeply integrated into Fusio, so I dont see currently a way to use an external authorization server.

best regards
Christoph
Reply all
Reply to author
Forward
0 new messages