An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Hi @curious7
Thank you for reaching out to Microsoft Q&A. Great job sharing all the information; that is always a huge help.
Yes, for a server-to-server integration, using APIM subscription keys with OAuth 2.0 access-token validation is a reasonable defense-in-depth approach.
I would use the subscription key for product entitlement, metering, and the ability to suspend access at the APIM subscription level. I wouldn't treat it as the caller's primary identity: the APIM documentation notes that subscription keys are useful alongside another authentication or authorization mechanism, but are not strong authentication by themselves. Configure validate-jwt on the relevant API or product scope and validate the B2C token's issuer, audience, expiry, and required permission claim(s). The policy supports OpenID Connect metadata, audiences, issuers, and required claims.
See Authentication and authorization to APIs in Azure API Management and Validate JWT.
For Q2, documenting the token endpoint is expected for an OAuth client-credentials integration. The endpoint, tenant/policy, grant type, and scope=<API-application-ID-URI>/.default are integration parameters, not secrets. The B2C documentation shows this exact token endpoint pattern and request shape. What must remain confidential is the client credential. Do not put a client secret in the developer portal, browser-based test console, sample code, URLs, or support tickets. See Set up OAuth 2.0 client credentials flow in Azure AD B2C.
For Q3, there is no APIM setting that turns an approved product subscription into a B2C application registration and client secret. They are separate security objects with separate lifecycles. For each customer integration, I would normally:
- Create a confidential client application registration.
- Grant only the application's required API permissions/application roles and admin consent.
- Require the corresponding
scpclaim at APIM; optionally validateazpagainst an allow-list of client IDs. - Deliver and rotate the client credential through a controlled onboarding process, independently of the APIM subscription key.
The B2C flow documentation requires a caller application, client secret, API application roles, and admin consent. If the onboarding must be automated, APIM supports delegating registration or product subscription to custom logic; in my view, that logic should initiate a separate audited identity-provisioning and secure credential-delivery process. It should not derive or reuse a B2C credential from an APIM subscription key. The APIM developer portal guidance describes this external API/SaaS pattern and delegation option: Secure access to the API Management developer portal.
One important planning point: B2C client credentials are documented as public preview. Also, Azure AD B2C is no longer available for purchase by new customers, although existing customers can continue using it. For a new long-lived implementation, I would assess Microsoft Entra External ID before committing to B2C. See the Azure AD B2C FAQ.
This assumes the customer application is a server-side confidential client. Client credentials are not suitable for an SPA or mobile application, where a client secret cannot be protected.
Please 'Upvote ' (thumbs-up) and 'Accept' as an answer if the response was helpful. This will benefit other community members who face the same issue.
Best regards, Andrew S Taylor