Hello Scott,
sorry for not providing more info in the original mail.
From the debug log:
HTTPAPI Ver 1.42 released 2020-10-12
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R3M0
This is the relevant code:
if ws_debug or ws_debug_pgm or F0000I = 'Y'; // Write log?
if F0000C = 0;
F0000C = uniqueId();
endif;
http_debug(*on: '/tmp/WS-Logs/' + P0 + '_'
+ %char(F0000C) + '_'
+ %char(F0000J) + '.log');
else;
http_debug(*off);
endif;
monitor;
if http_setOption('network-ccsid': '1208') = -1;
F0001J = http_error();
F0005W = 'ERR';
endif;
on-error;
F0001J = http_error();
F0005W = 'ERR';
endmon;
F0000S = 'grant_type=password&scope=openid'
+ '&client_id=' + http_urlEncode(%trimr(%subst(F00067: 1: 20)))
+ '&client_secret=' + http_urlEncode(%trimr(%subst(F00067: 21)))
+ '&username=' + http_urlEncode(%trim(F00006))
+ '&password=' + http_urlEncode(%trim(F00007));
monitor;
rc = http_req('POST'
:%trimr(F0000F)
:*omit
:rqOutput
:*omit
:%trimr(F0000S)
:'application/x-www-form-urlencoded'
);
F0001Q = rqOutput;
if rc <> 1;
F0005W = 'ERR';
else;
F0005W = '';
endif;
on-error;
F0001Q = '';
F0005W = 'ERR';
endmon;
F0001J = http_error(x1: x2);
F0001H = x1;
F0001I = x2;
if F0001I > 200 and F0001I < 300;
F0005W = '';
endif;
........
monitor;
y_string = %trimr(F0001Q);
y_docNode = yajl_buf_load_tree( %addr(y_string: *data):
%len(y_string):
y_errmsg );
if y_docNode = *null or y_errmsg <> '';
F00057 = y_errmsg;
F0005W = 'ERR';
endif;
on-error;
F0005W = 'ERR';
endmon;
x1 = 0;
dow yajl_object_loop(y_docNode: x1: y_key: y_val);
select;
when y_key = 'access_token';
F0001A = yajl_get_string(y_val);
when y_key = 'expires_in';
t_timestamp = %timestamp() + %seconds(yajl_get_number(y_val) - 5);
F0001D = %dec(t_timestamp);
when y_key = 'refresh_token';
F0001C = yajl_get_string(y_val);
when y_key = 'refresh_expires_in';
t_timestamp = %timestamp() + %seconds(yajl_get_number(y_val) - 5);
F0001E = %dec(t_timestamp);
when y_key = 'id_token';
F0001B = yajl_get_string(y_val);
when y_key = 'error';
F0001F = yajl_get_string(y_val);
when y_key = 'error_description';
F0001G = yajl_get_string(y_val);
endsl;
enddo;
monitor;
yajl_tree_free(y_docNode);
F0005W = '';
on-error;
F0005W = 'ERR';
endmon;
BTW. This is part of a tool generated pgm. Pls ignore the strange field names.
Thanks and best regards
Richard