4d / 4D-NetKit

4D NetKit is a built-in 4D component that allows you to interact with third-party web services and their APIs.
Other
14 stars 8 forks source link

Feature Request - Custom Providers #4

Closed Ganbin closed 9 months ago

Ganbin commented 1 year ago

User Story

As a developer, I want to be able to use the 4D Net Kit component to request third party that implement OAuth2 with some specific implementation that are not fully covered by the spec.

Examples

Authorize URL of third party app: {{OAuthBaseUrl}}/authorize?client_id=<Client_ID>&response_type=code&redirect_uri=<Redirect_URL>&customParam={{customValue}}

Another example is : {{OAuthBaseUrl}}/{{tenantUUID}}/token

Features that could help to solve this case

  1. Allow to easily add our class inside the component that inherit from a base class. This base class could implement interface functions that allow to have a callback when getting the authorize or token URL. By default the function return the classic URL but our specific class can implement a specific callback to add some custom parameters or replace some placeholder in the URL.

  2. Having a collection that allow to add parameters and their values.

  3. The tenant in the URL seems to be covered by the Microsoft solution, but I'm not sure if this can be used for other providers.

yannicktrinh commented 1 year ago

I think the latest implementations in the component meet your needs (you now should be able to use any oauth2 provider). Can you confirm that this is the case, and if so, close the issue? Thanks for the feedback

Ganbin commented 1 year ago

Hi, I have tested the latest code in this Github repo and I could connect to an external OAuth2 provider. However it was not the case in the default component in the v20. I hope this latest code will soon be merged in the v20. (or maybe the latest nightly build already have it)

The only case that I could not test (and didn't look at the code if this is possible) is the use case with the customParam={{customValue}} when doing the authorize or token request.

Ganbin commented 1 year ago

Postman has recently added this feature nicely:

2023-06-09_17-23-02
yannicktrinh commented 9 months ago

I'm closing this "old" issue. If you encounter any other problem or lack of functionality, please open a new issue.

Regards