validate jwt tokens inside stored procedure

Bert Sachs (DB) 0 Reputation points
2023-03-27T15:58:55.15+00:00

Hi

I have an azure api (web api) that access an azure sql database. The access to azure sql is secured by the user managed identity of the api service.

As an additional security layer i want to pass the bearer access token to a stored procedure and validate. Is there any SQL Server built-in functionality to validate an AzureAD access token and extract claims and scopes?

regards,

BSDB

Azure SQL Database
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,639 questions
{count} votes

1 answer

Sort by: Most helpful
  1. 2023-03-29T04:40:40.4433333+00:00

    Hello @Bert Sachs (DB) , Azure AD access token are validated by Azure SQL Server, otherwise any could be accepted. Additional authorization rules are applied based on Azure SQL roles and permissions. Using managed identities is already a security best practice.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.