Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There can be Web applications internally calling the OAuth secured APIs. Once Web applications are published and accessed through the AppManager WSO2 App Manager gateway, user is authenticated using the SAML SSO. In However, there can be Web applications which internally call OAuth-secured APIs. In this feature, you can use the same SAML token generated by the WSO2 App Manager gateway, and get an OAuth2 access token by calling the token endpoints used by these APIs.

Table of Contents
maxLevel3

The  The below diagram depicts this scenario.

Obtaining an Auth2 token by providing a SAML token flow diagramImage Modified

...


















 

Make sure that following prerequisites are met before following the instructions on publishing the web application for obtaining an OAuth2 access token

Configuring the API provider of App Manager

WSO2 App Manager uses WSO2 API Manager as the API Provider. In order to provide an OAuth2 token using the SAML token provided by the IDP of App Manager (WSO2 IS), APIManager needs to include IS as a trusted IDP provider. Configure WSO2 API Manager as follows.

Image Removed

...

Table of Contents
maxLevel3

Publishing the Web application for obtaining an OAuth2 access token 

 If a particular Web application needs accessing to access OAuth-secured APIs internally, it needs to provide the following OAuth parameters of the APIs when publishing in the Step 4 - Advanced Configuration of creating the Web application in the App Manager, as depicted below.

  • API Token Endpoint - URL of token endpoint used by the APIs.
  • API Consumer Key - the consumer keys of the OAuth APIs.
  • API Consumer Secret the consumer secret keys of the OAuth APIs.
  • API Name alias name for the APIs.

Image Removed

Once the Web application is created on App Manager, it will wrap these details and generate a new consumer/secret key pair for the Web application [WCk1, WCSk1]. Actual Web application can use this consumer/secret key pair generated by the App Manager publisherPublisher, when it need needs to get an access token to call the registered APIs. 

 You can see  Follow the steps below to view the consumer/secret key pair generated by WSO2 App Manager, 

  1. Log in to the

...

  1. App Publisher of WSO2 App Manager using the following URL with admin/admin credentials: http://<IP_ADDRESS>:9763/publisher
  2. Click on the Pizza Shack application in the Web applications list.
  3. In the the Overview section of the Web application, click OAUTH Parameters tab.
    You can see the consumer/secret keys generated for it in WSO2 App Manager as follows.
    Image Added

Invoking App Manager Token API from the Web app

...