Having the following error when creating a connection with custom connector configured to use OAuth.
The same credentials have been working fine but suddenly stopped working.
My authentication server does not have any 500 error in logs.
Error text: The request failed with client error: 'Input parameters are invalid. See details for more information. Details:OAuth2 Authorization Flow failed for service Generic Oauth 2. OAuth 2 sign in 'OAuth2LoginStrategyCore' failed to exchange code for access token. Client ID and secret sent in form body.. Response status code=InternalServerError. Response body: { "statusCode": 500, "message": "Internal server error", "activityId": "b6b23f1a-e9c0-4946-9834-a2cb4e6ffae9" } Client ID and secret sent in Basic authorization header.. Response status code=InternalServerError. Response body: { "statusCode": 500, "message": "Internal server error", "activityId": "f3300244-47b1-465b-ae4b-b84a02468170" } '. The correlation Id is 'd2e7625a-1f8e-4179-bc33-0112dda63a0b'.
The issue you seeing is tricky , please try below points
Double-check OAuth2 settings in the Custom Connector (Authorization URL, Token URL, Client ID, Secret, Scope).
Ensure the Redirect URI in your identity provider matches PowerApps.
Try using Postman to manually get the OAuth2 token to see if it's working outside PowerApps.
Check if PowerApps recently changed its OAuth requirements (security updates might affect this).
If your OAuth provider allows only one authentication method, choose either Form-Encoded or Basic Auth, not both.
Look at PowerApps Custom Connector logs for more details.
Verify that your API server isn’t rejecting the request (check server logs).
If the issue started suddenly, check if Client Secret expired or was rotated.
Some OAuth providers have rate limits—ensure you’re not hitting them.
Check Microsoft forums for recent OAuth2-related issues in PowerApps.
Try creating a new connection from scratch to rule out corrupted settings.
If using Azure AD, check Audit Logs for any errors related to sign-in attempts.
If nothing works, temporarily switch to another authentication method (API Key or Username/Password) for testing.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.