Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

soa doesnt recognise oauth token generated as string

Oauth token is generated in a string format. But the element cannot be captured as a element to be used for the following tests. How to read this token in string format and make it use for following test cases. Any approach to be followed??

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,302 ✭✭✭

    But the element cannot be captured as a element to be used for the following tests

    Can you please be more specific? OAuth access tokens are returned as a JSON property named "access_token". You would typically extract the value using a JSON Data Bank.

    Any approach to be followed??

    SOAtest 2022.2 introduced enhanced support for OAuth where you no longer need to setup a special extraction for the access token. Instead, there is now an OAuth 2.0 Authentication object that can be added to your test suite. Any clients that require the access token will get it automatically from this shared Authentication object, where the token endpoint will be automatically queried for the access token.

    See OAuth Authentication for details on this new approach. For the previous approach, where you would need to setup a separate test case to acquire and extract the access token with a JSON Data Bank, see the docs for SOAtest 2022.1.

  • Thanks Benken. My token generator test cases was Rest api call and i tried both xml data bank and jason databank. output was in the string format and it wouldnt let element to be extracted. Not sure where the issue is?