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:
- Can we access token through API?
- Does ABP.IO require special configuration to enable password grant?
- Are there additional security requirements for non-interactive flows?
- Should I be using a different client_id for API access vs web access?
- Is there any logging that would help diagnose why this client is being rejected?
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: