Get JWT Token
Hi Guys,
I'm trying both of these methods to get a JWT token but none is working for some reason and not sure what I'm missing?
it works when I tested it from Postman
Thanks
Product version: Ensemble 2018.1
Hi Guys,
I'm trying both of these methods to get a JWT token but none is working for some reason and not sure what I'm missing?
it works when I tested it from Postman
Thanks
What error do you receive?
No errors, tSc returned as null, which I guessing that the post didn't go through because I'm doing something wrong in my code?
If it's null, your code might not even be getting to the Post method. Are you running this in the terminal, and are you getting any other errors there? Is your RTLS SSL configuration set up in the management portal?
Also, when the response comes back, it's JSON, so if you want to get just the token, you'd have to:
set AuthTokenValue = tokenObj.%Get("access_token")
Yep exactly, getting null means that my post might not even get there and I'm trying to find out the reason.
Yes RTLS is configured in SSL and I'm actually using it in other place for other clients and working fine but not with this client?
Thanks
Hello @Rochdi Badis
Are you using the HTTP adapter? If so, try using the
..Adapter.SendFormData(.tHttpResponse,"POST",tHttpRequest,,,tURL)
method. Your URL will be your server concatenated with the path, which in your case you are setting directly in the POST method.Haven't used HTTP adapter before, any sample on how to use it ?
when I try it from the Terminal I get the following error:
I saw the #Ensemble tag, so I thought you were using a Business Operation. Another thing I noticed is that you are not setting the server port that will be called.
Thanks, our client didn't recommended a specific port and it worked fine from Postman without it, but now I've set the default port 443 and still the same error?
when I try it from the Terminal I get the following error:
I believe you have to post excluding the domain name in the URL (As you already specified domain under Server property of HttpRequest object). From your terminal screenshot , try like below ?
set tSc=AuthToken.Post("/B2C_1A_client_credentials_signIn/oauth2/v2.0/token?ptid=.........")
If that's the issue, you could also try the following, and it will post to that location using the parameters you specified with InsertFormData:
set AuthToken = "/B2C_1A_client_credentials_signIn/oauth2/v2.0/token" set tSc = AuthToken.Post()