Implementation of a DLL that provides the call of an exported OAuth 2.0 function that returns a .json file with access and renewal tokens after successful user authorization. In the negative case, detailed functional and technical error messages are returned in the json file.
Supplement
The DLL function is implemented in C# as an OAuth 2.0 authorization flow using the authorization code grant type. The OAuth parameters required for the OAuth function, such as oauthUrl, clientId, redirectUrl and scope, are read by the function from an appsettings.json file. To increase security, a CodeVerifier and a CodeChallenge are created for the PKCE extension of OAuth 2.0. The OAuth Url is then called asynchronously with all the necessary parameters and a browser is started, which waits for a response using the transferred redirectUrl. Once the response has been received, it is checked again for the CodeChallenge and the status. If everything is correct, the actual OAuth Url for retrieving the access token and the refresh token is called and returned a .json file.
Subject description
Access from a tied agent computer to certain resources in the Company Cloud. A Dll function is implemented based on the OAuth 2.0 process using 'Proof Key for Code Exchange' (PKCE). This procedure is necessary because it is not possible to store a secret token (key) on the tied agent computer itself. With the OAuth 2.0 procedure, it is possible for the public client to carry out authorized access to online resources with a high level of security without compromising interception attacks. A ComServer DLL is written in C# with an exported OAuth 2.0 function that returns a .json file with access tokens after successful user authorization.