I'm working on a C# command line tool which automates some deployment tasks by sending requests to the API of an on-premise installation (in this specific case UiPath Orchestrator).
I've used until now bearer token authentication, which is being phased-out and need to move to OAuth 2.0 for authentication on the respective on-premise setup.
So far I've found some examples on how to authenticate using OAuth 2.0 with client_credentials
grant flow type and have been able to successfully implement it myself:
The problem is that in my specific case client_credentials
grant flow type is allowing the user to access too many resources and need to use instead authorization_code
grant flow type, which lets the user access only allowed resources.
Would appreciate some simple/basic code snippets for authorization_code
grant flow type, since so far found only the following examples, which I'm struggling to fully understand and not sure if those are applicable for my specific case: