Hello, Using PB 2019 R3
I should get JWT authentication with the following parameters:
"Authorization":"Basic " + base64Urlencode(clientID:clientSecret)
"grant_type":"client_credentials"
"client_id":clientID
"scope":"CamDistributorTenant"
I have tried with the examples povided by this site, but I wasn't able to get the Token code
Instead I succeeded with C# in Visual Studio IDE but I need to take a lot of data from many json requests and in PowerBuilder it's all so much easier to manage this data.
I tried to use:
RESTClient and Getjwttoken
where I put all above data in json format like this:
Getjwttoken("https://dryrcmapi-ec1.srv.ygles.com/camapi/v0/authorization/token", '{"Authorization":"Basic YzVlMjVj.....XFk=","grant_type":"client_credentials","client_id":"c5....cdxt","scope":"CamDistributorTenant"}', lToken)
but in lToken variable return "<!DOCTYPE HTML PUBLIC "-//W3C//DTD..... <H1>403 ERROR</H1>...."
then I tried also:
GetOauthtoken with TokenRequest parameter but here I don't know where I have to put the string "Basic " + base64Urlencode(clientID:clientSecret) so dosen't work
Thanks for a hint
now works fine
but I thought that
lo_restclient.SetRequestHeaders("Authorization:Bearer " + ls_JWTToken)
it should work becouse it had to replace the previous Header
thank you
regards
alberto trebbi