Dmitrii Kuznetsov · Sep 1, 2019

How do I debug and test the IRIS OAuth server?

OAuth server to be deployed on the IRIS learning cloud platform. Clients - one on the other instance of the learning IRIS server, the other client locally on my computer in the container docker.

Both clients get a seemingly correct link (through ##class(%SYS.OAuth2.Authorization).GetAuthorizationCodeEndpoint()) to the login request form:

And in the answer from a server the empty answer instead of the form of a login comes.

If to break the reference to authentication (to remove an id of the client) the OAuth server works and something handles: "Unexpected request - no client_id".

How do you recommend debugging in this context?

1 579
Discussion (3)1
Log in or sign up to continue

Have you looked at @Daniel Kutac series of articles about OAuth2? In part 3 he mentioned about debugging. Kind of like this should help you.

set ^%ISCLOG=5
set ^%ISCLOG("Category","OAuth2")=5
set ^%ISCLOG("Category","OAuth2Server")=5

Dimitry, thank you for the tip! 
Now I see all the details when there are bugs.

But the question remains relevant. The server does not recognize the request of my client erroneous and thus gives out an empty answer. How to do tracing of calls for system classes if all goes "ok"?

At replacement inside of inquiry in parametres - references slash "/" on its code %2F, the OAuth server began to answer queries.

I did a test in another application. Error processing parameters-links within requests repeats itself.

Maybe the reason in incorrect processing of inquiries containing links with slashes in a system class %CSP.Request?