foundation-API icon indicating copy to clipboard operation
foundation-API copied to clipboard

Include information about client name and version when calling server API.

Open bagabont opened this issue 2 years ago • 2 comments

As a service provider it is important to identify clients which consume an API and their version. Reason being, sometimes there are bad requests, buggy versions, deprecate old versions, etc.

A suggestion is to use X-Client-Name and X-Client-Version.

Similar to: https://stackoverflow.com/questions/17491730/identifying-the-version-of-a-client-web-app-during-http-requests

bagabont avatar May 04 '22 11:05 bagabont

From the discussion in the OpenCDE Documents API Project:

  • The original idea was to use the User-Agent header
  • Since the User-Agent header can't be changed for browser based clients, the new proposal is to add custom headers

However, we're not sure if there's a use case where a browser-based client would use older versions instead of the latest one, and authenticated clients can always be identified via their OAuth2 token that is present in authenticated requests.

@bagabont, could you join the next BCF call to discuss this in more detail?

GeorgDangl avatar May 09 '22 09:05 GeorgDangl

Hi Georg, we will try to join. Do you know if it would be possible to acquire the client version from the OAuth2 token?

bagabont avatar May 10 '22 09:05 bagabont