Authorization

4 posts, 0 answers
  1. Tatsiana
    Tatsiana avatar
    2 posts
    Member since:
    Oct 2016

    Posted 27 Oct Link to this post

    Hi all, my API requires authorization, but I'm not sure how to add Username/Password and the Authorization type.

    Could you please provide an example?

     

    Thanks in advance.

    Tania

  2. Oleg
    Admin
    Oleg avatar
    33 posts

    Posted 28 Oct Link to this post

    Hello Tania,

    The Beta version of Test Studio for APIs does not have UI support for authorization yet (I hope we will be able to deliver this soon in our future releases).

    Though you can make authorized calls, but you would need to manually set the attributes required for your http requests. You mentioned that you need to add Username/Password and Authorization type so you probably mean that you need to use Basic authentication. In that case, you can use an "Authorization" header with value: "Basic your-base64-encoded-credentials-here".

    I have attached a sample project so that you could see an example. You can see in the sample, that I have declared two variables in the test case for "username" and "password", and a third one "credentials-concatenated" that I use to concatenate the two together with a colon ":" in the middle. I have used a Set-Variable step that applies Base64 encoding to the "credentials-concatenated" and saves the result in a "credentials-encoded" variable. Finally, in the http request, I have added an "Authorization" header with value: "Basic {{credentials-encoded}}". The {{credentials-encoded}} part will be replaced with the Base64-encoded credentials (you can see more about referencing variables here).

    If you need to use another type of authentication instead of Basic, you can achieve it in a similar manner, just check what headers/ query strings/ payload your service expects to receive.

    Let us know if we can be of further assistance.

    Regards,
    Oleg
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Tatsiana
    Tatsiana avatar
    2 posts
    Member since:
    Oct 2016

    Posted 28 Oct Link to this post

    Hi Oleg.

    Thnaks for the assistance. Will check you variant with Basic authentication soon.

    Actually we have 3 types of authentication, each of them can be enabled on demand (Basic, Form-based, sertificates). Hope you will support all of them :)

     

    Regards, 

    Tania

  4. Oleg
    Admin
    Oleg avatar
    33 posts

    Posted 28 Oct Link to this post

    Hi Tania,

    Thanks for the clarification. Please take your time and share your observations once you have any results. I will be glad to assist you further in case you need further assistance.

    Regards,
    Oleg
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top