Skip to content

OAuth2 Password Grant Flow Not Working in ABP.IO API #22794

@yash202

Description

@yash202

I'm attempting to get an access token programmatically through the /connect/token endpoint using the password grant flow. While the identity service works perfectly in the web interface, I'm having trouble getting tokens via direct API calls.

Current Approach:

http
POST https://localhost:44387/connect/token
Content-Type: application/x-www-form-urlencoded

grant_type=password
username=yash
password=Yash@123
client_id=IdentityService_Swagger
scope=IdentityService openid

Error Received:

json
{
"error": "unauthorized_client",
"error_description": "This client application is not allowed to use the token endpoint."
}

Additional Context:

The web version (interactive flow) works fine - users can login through the UI

Same credentials work in the web flow

Need this for automated testing and service-to-service auth

Using ABP.IO's built-in IdentityServer/OpenIddict implementation

What I've Verified:
✓ User credentials are correct
✓ Client ID exists in the system
✓ Scopes are registered
✓ Endpoint is reachable

Key Questions:

  1. Can we access token through API?
  2. Does ABP.IO require special configuration to enable password grant?
  3. Are there additional security requirements for non-interactive flows?
  4. Should I be using a different client_id for API access vs web access?
  5. Is there any logging that would help diagnose why this client is being rejected?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions