OAuth2 Tutorial

This tutorial provides an example of how you can enable OAuth 2 authorization for a REST request.

To configure OAuth2 authorization, you need to --

  • Create and configure an authorization profile.
  • Retrieve an access token.

1. Adding Authorization Profile

First, add the OAuth 2.0 authorization profile:

  • Open the REST Request.

  • Open the Auth tab.

  • Click Add New Authorization.

  • In the resulting dialog, select OAuth 2.0 type and enter the profile name. Click OK.

2. Configuring Authorization and Retrieving Access Token

After you add the authorization profile, you need to get access token from the server. In this tutorial, we get it by using the Authorization Code grant method:

  • Click Get Token.

  • In the subsequent dialog, enter Client Identification and Secret, Authorization URI, Access Token URI and Redirect URI. For details, see the Grant Methods topic.

  • Click the Get Access Token button:

SoapUI will get the access token from server and display it in the Access Token field. When you send the request, the token will be attached to it to authorize with the service.