AADSTS7000215: Invalid Client Secret Provided Error in Azure App Registration

While working on a Windows Forms application to manage folder-level permissions in SharePoint, I needed to fetch user names from Azure Active Directory.

To do this, we must register an app in Azure and then use our application’s Client ID, Tenant ID, and Client Secret. However, when I ran the application, I encountered an error related to authentication.

AADSTS7000215: Invalid client secret provided.
AADSTS7000215: Invalid Client Secret Provided

This error halted the process, which was attempting to connect to Microsoft Graph using the registered Azure AD application.

In this tutorial, I will show you how to fix the AADSTS7000215 error so you can successfully connect your SharePoint-integrated app to Azure AD.

AADSTS7000215: Invalid Client Secret Provided

In the Azure portal, when you register an application and create a client secret, Azure shows:

  • A Secret Value (which should be copied)
  • A Secret ID (used only for reference)

Authentication will fail if you copy and use the Secret ID in your code.

Now I will show you where you can find the Secret Value, then you will use it in your code:

  1. Go to Azure Portal -> Azure Active Directory -> App Registrations. Select your registered app. In my case, LibraryFolderSelectorApp is my application name.
AADSTS7000215 Invalid Client Secret Provided in Azure App Registration
  1. Then click Certificates & secrets, where you can see the secret value. If you didn’t copy the Secret Value earlier, delete the current one and create a new one. Copy the Secret Value immediately after it’s generated.
Client secret key is expired error - Azure

Use this Secret Value in your application code. This will fix the Invalid client secret provided error and allow your SharePoint-connected app to fetch user details from Azure AD.

You may like the following tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…