Error on App registration connection

Shane Paulsen 0 Reputation points
2023-04-23T06:23:55.3866667+00:00

I created an app registration to be able to connect my one drive to WordPress from the plugin Wp File Download plugin. When I try and connect I get this message below: Error communicating with OneDrive API: Client error: POST https://login.microsoftonline.com/common/oauth2/v2.0/token resulted in a 401 Unauthorized response: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret provided. Ensure the secret being se (truncated...) I am not sure how to fix this.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,802 questions
{count} votes

2 answers

Sort by: Most helpful
  1. dkrishnaveni-MSFT 1,946 Reputation points Microsoft Employee
    2023-04-23T07:29:47.5766667+00:00

    HI @Shane Paulsen , The error message indicates that the client secret provided for the app registration is invalid. The client secret is a secret key that is used to authenticate the app registration with the OneDrive API. To fix this error, you can try the following steps:

    1. Double-check that the client secret you entered in the WP File Download plugin matches the client secret in the Azure portal for your app registration. Make sure there are no extra spaces or characters in the client secret.
    2. Ensure that the client secret has not expired. In the Azure portal, go to the app registration's "Certificates & secrets" page and check the expiration date of the client secret. If it has expired, generate a new one and update it in the WP File Download plugin.
    3. Check the permissions of the app registration in the Azure portal. Make sure that the app registration has the necessary permissions to access the OneDrive API. You can do this by going to the "API permissions" page of the app registration and verifying that the necessary permissions are granted.
    4. Check that the app registration is properly configured to use the correct OAuth version. The error message indicates that the API is using version 2.0, so make sure that the app registration is also configured to use OAuth 2.0. Regards, Divya
    0 comments No comments

  2. JamesTran-MSFT 36,476 Reputation points Microsoft Employee
    2023-04-24T22:45:22.76+00:00

    @Shane Paulsen

    Thank you for your post and I apologize for the delayed response!

    Error Message:

    AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '123456789-1234-1234-1234-1234567890987'.\r\n

    From your error message, it looks like your app is attempting to sign in without the necessary or correct authentication parameters. In order to resolve your issue, you'll have to navigate to your Azure AD App Registration, open the Certificate & Secrets menu, and ensure that you're using the correct Secret Value within your App and not the Secret ID.

    User's image

    I hope this helps!

    If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.


    Additional Links:


    If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.