OAuth2 Clients. Getting Access Token



I have setup an OAuth2 Client and successfully tested getting a token (Client Credential type).

Now, how can I use this in Vision? I would like to get a fresh token when needed, I would also like to read the status code of the request. Obviously will use the token to connect to another site to download other resources.

I have also tried to implement the system.net.httpClient() methods to get the token but it's not working, I am getting a 401. Have tried different header configurations, still error.

It works in Postman. I provided the Client ID and Client Secret, but Postman passes a different value altogether as seen in the Request Headers below:

I have read through some of the previous posts but none of them had a solution.

Has anyone been through this and had a proper solution? Thanks.

Exposing OAuth2 clients to scripting is something we're planning to implement in the future but isn't available right now.

OAuth2-based SMTP profiles are the only thing that use the configured OAuth2 clients.

Hi Kev,

That's what I figured out after further reading through the manual. This will be a much sought after addition I believe.

Dear All,

For anyone going through this path, here's what I did:

Stuffed all parameters into the header, created a HttpClient and did a post:


response.statusCode gives the status code and
response.test gives the returned string, like so:


1 Like