OAuth error - The best overloaded method match for 'System.Exception.Exception(string)' has some invalid arguments

Hi there! I’ve been using Vanya for a week or so connected to an Azure HDS FHIR server and it works great! I’ve just tried to hook it up to one of my organisations Oracle/Cerner Millennium FHIR Ignite APIs and I’m getting an error with the OAuth flow configured:

One or more errors occurred. (The best overloaded method match for 'System.Exception.Exception(string)' has some invalid arguments)

If I add the bearer token to the headers manually, it works.
If I request the OAuth token manually (in RapidAPI), I get the following payload returned:

{
  "access_token": "<access token here>",
  "scope": "system\/Observation.read system\/Patient.read",
  "token_type": "Bearer",
  "expires_in": 570
}

Are there any logs or anything I can grab? The file /Library/Applications Support/Vanya Client/log.txt doesn’t exist for me either.

Thanks!


M1 MacBook Pro @ Sequoia 15.3
Vanya 0.9.0 beta

Hi Joe.

When you’re using RapidAPI, which parameters are you passing in? Is it just client id and client secret or are you also passing in a scope?

Assuming you’re on a Mac, does the /Library/Applications Support/Vanya Client/ folder exist, and if so can you see any files in it? The log file should be in there.

Hi Darren,

In RapidAPI I am passing the scope too - system/Patient.read,system/Observation.read. I have this set in the extra parameters on Vanya but it still throws that exception

image

I am on a Mac, but the folder /Library/Applications Support/Vanya Client/ doesn’t exist.

The structure and content of the response body is correct, so the issue might be happening before this.

I noticed a typo in the folder name: /Library/Application Support/Vanya Client/log.txt

It should be “Application Support” and not “Applications Support”. This folder contains the server connection details as well as the log file, so it’s there somewhere, otherwise none of your connections would work.

There’s nothing else you’re sending in the request to get the token using RapidAPI that’s missing from the Vanya OAuth connection details?

I found the log file here: /Users/joe/Library/Application Support/Vanya Client/log.txt

I’ve intercepted the connection traffic with Fiddler and it looks like the issues lies in how the Ignite APIs have implemented the client credentials flow. Vanya assumes the token API takes the client ID and secret in the body, where the Ignite API base64 encodes them in the Authorisation header basic auth style - ie Authorization: Basic b64(<clientid>:<clientsecret>). This is a configuration in RapidAPI I had configured that I hadn’t taken into account.

Is there a configuration item for this in Vanya, and if not, could I request it somehow?

1 Like

Good to get to the bottom of this Joe.

Vanya implements the client_credentials and password flows, but not the Basic flow. We can work to put this in for the next release. I’ll let you know when there’s a version ready for test - shouldn’t be too long.

1 Like

Fantastic, much appreciated :slight_smile: