Thanks Jayprakash,
Gateway Type: Datapower API Gateway.
I tested enabling OIDC as well as disabling OIDC, no luck, same error is turning up.
To answer your questions.
1. YAML file doesn't give the source parameters for token generation.
/oauth2/token:
post:
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
summary: >-
Endpoint for obtaining access token using Authorization code,
Application and Password grants
description: >-
This endpoint allows requesting an access token following one of the
flows below:
- Access Code (exchange access code for an access token)
- Client Credentials (2-legged, resource owner credentials are not obtained)
- Resource Owner Password Credentials (2-legged, client provides resource owner name and password)
- Refresh Token (exchange refresh token for a new access token)
parameters:
- name: grant_type
in: formData
required: true
type: string
enum:
- authorization_code
- password
- client_credentials
- refresh_token
responses:
'200':
description: 200 OK
2. Even if I tested through Assemble (Gateway in version 10.0.*) it is giving same error response and I checked that parameters is not an issue.
If the parameters are not passing or incorrect values are send then it is throwing error as "invalid request" but not "
TokenManager Runtime Error".
Issue resolved:
Not sure why oauth-auto-generated-1 step is trying to generate Token.
------------------------------
Avik Naskar
------------------------------
Original Message:
Sent: Thu September 29, 2022 01:07 AM
From: Jayprakash Yadav
Subject: API Connect Native Oauth - unable to get token for AccessCode Flow
Dear Avik,
What is your Gateway Type?
There are multiple way to check how to pass the parameters. Also please see if you have enabled OIDC
1. Check the yaml source parameters, you will find details to pass
2. Open API Connect Testing in assemble , open any API secured using it, test API using test tool in API Connect, also open browser network. After every click token check new entry in network table, you will find exactly how to pass.
------------------------------
Jayprakash Yadav
------------------------------