cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with using Token Blue Prism - PEGA web service

Hello, 

I am struggling to set up my web service to start using Token instead of Basic authentication.

1. I tried to follow this post:  Blue Prism Product

I can generate token on the process level and it is for sure a correct token.

Therefore: 

I have created credential slot with "Bearer Token" type.

I dynamically set the token as "password" using "set" action in Credentials VBO.

I set up "Common Authentication" part of the service to "Bearer Token" and select Credential slot mentioned earlier.

I am keep receiving 401 error.

2. I also tried this solution:

https://community.blueprism.com/communities/community-home/digestviewer/viewthread?GroupId=145&MessageKey=9de26d97-5c8f-40ab-9f18-2cce689c21c1&CommunityKey=3743dbaa-6766-4a4d-b7ed-9a98b6b1dd01&tab=dig...

So I used the same "Bearer Token" credential slot which I update from the process.
Set up Common Headers to Name "Authorization"; Value: Bearer [Token]
& Common Parameters Name "Token" which I expose to the process and update (I also update token within credential slot so I am not sure if there is a point in providing it 2 ways at the same time, but that is what was suggested in the trade).

I also get 401.

Please help.

I am not attaching any screenshot because it seems to be more readable, but please let me know in case I can provide any useful info.

9 REPLIES 9

EslamGhandour
Level 4
Hi Dominika,

I would suggest testing your calls with postman or something alike to make sure your call is valid and reaching the end point.

Additionally, the post does not suggest adding the 2 ways at the same time. This is probably why it is not working. You should either add it in "Common Header​s" and set "Common Authentication" to none, or the other way around. 
Me personally I always use the "Common Headers" and it always works.

@EslamGhandour, thank you for your swift reply.

​It goes through when I use SOAPUI (that is why we are sure token is correct).

In the beginning I tried it with " Common Authentication" being blank. I should have mentioned it - sorry. I double checked it now and it is still giving me 401.

EslamGhandour
Level 4
Based on what you already tried, everything should be working as it is. 
If you can provide some screenshots from the inputs being passed to your webservices, maybe me or someone else can notice what would be the possible issue.

Alternatively, try to use the Utility - HTTP VBO to recreate the request and see if it goes through. I would suggest recreating it from scratch without copying inputs from the webservice. That way any typos or possible problems will be avoided.
If you will do that, please also include the values being passed to the HTTP request action and tell us if it works or still facing the same output.

Ah, yes, what I should have probably also mentioned (sorry) is that we have already used the service multiple times just with basic authentication. So the same input, outputs, endpoints etc. are all the same.
The only change now is the authentication method.

ewilson
Staff
Staff
@Dominika.Zolotarew,

You mentioned SoapUI. Is the web service you're trying to work with a SOAP web service or REST?​ The reason I ask is that the WebAPI Service feature of Blue Prism is targeted at RESTful services.

When you say you can generate a token on the process level what does that mean? Are you referring to the creation of an API key via the admin screens/utilities of Pega?

Cheers,
Eric

Hello @ewilson,

I am using SOAPUI because postman is for some reason banned in my department, however, it s RESTful API 🙂


I currently ​​use cURL through cmd (since I have issues with cookies when trying to use normal Utility - HTTP) to generate a NINAA Token.

Does it answer your question ?

ewilson
Staff
Staff
@Dominika.Zolotarew,

Thanks for the clarification. Since this works via SoapUI what I would suggest is using something like Fiddler to capture the network traffic of the request from Blue Prism and then compare it to what SoapUI shows in its network traffic window and see if you see some obvious difference.

Cheers,
Eric​

Thank you for your suggestion. 

I am not familiar with fiddler, but I will figure it out and try follow your advice.

I will let you know how I did 🙂

Hello, I find out that it was very basic mistake on my side. 

I haven't noticed I was still trying to connect through https although service is only prepared for http for now.

It works now with the set up number 2:)

I did notice it thanks to Fiddler so thank you 🙂