@Joe S George , If your main issue is trying to get application authenticated with AAD, you certainly need to use the Client_Credential flow of OAuth 2.0.
B2C tenant and an AAD tenant are two different tenants. It all depends on that fact that where you have registered your application.
Suppose we have application named App1, which is registered in AAD tenant, then the app must request a token from AAD tenant to get itself authenticated. In that case your auth request should look like:
POST https://login.microsoftonline.com/{tenantid/tenantName}/oauth2/token
resource:https://graph.microsoft.com
grant_type:client_credentials
client_id : xxx-xxx-xxx
client_secret: xxx-xxx-xxx
on the contrary, if you have registered your application in the B2C tenant, then you need to make a call to the B2C tenant to get your application authenticated using the client-credential flow. But to note here, B2C as of now doesnt support the client-credential flow of OAuth.
Yes, we are deprecating the login.microsoftonline.com for only the B2C tenant as you mentioned and that is basically to draw a line of difference between the app being used for what purpose. To elaborate this, when you register an application in the B2C tenant using the App registrations blade, that app can be used to get a token both from the AAD tenant (which is the underlying the B2C tenant) as well as from the B2C tenant also. Now to remove the confusion of from where the token is being requested from, we are deprecating the use of login.microsoftonline.com for the apps being used to request tokens from the B2C tenants.
Hence what we suggest is to use:
- b2clogin.com while requesting tokens from B2C tenants.
- login.microsoftonline.com when requesting tokens from AAD tenants.
Note: Again would like to re-iterate, B2C tenant as of now doesnt support Client_credential flow, hence if you app is designed to fetch tokens using client_credentials flow, try using login.microsoftonline.com and get the tokens issued from AAD rather than B2C.
Hope this clarifies your doubts. Incase there are any more queries around this always feel free to reach out so that we can help you better and get you a better grip on the Azure Technologies.
Also, please do not forget to accept the response as Answer; if the above response helped in answering your query.