V2/token Endpoint failing
search cancel

V2/token Endpoint failing

book

Article ID: 225638

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

We are trying to make a call to the /auth/oauth/v2/token endpoint inside a gateway policy but there is no response. The call works fine from Postman and other client applications.

Environment

API Gateway 10.0

Cause

The call is failing on the gateway because there is no request body being passed to the /auth/oauth/v2/token endpoint (the policy fails on the Validate HTML Form Data assertion).

Resolution

The overall goal is to generate an access token within a policy. This can be done with a Set Context Variable assertion and Route via HTTP(S) assertion. See the attached sample policy.

Attachments

1633619355099__genToken.xml get_app