I want to allow users of a B2C-secured app to browse before deciding to register
To that end, I need to embed a Client Credential flow within my app
I have only been able to find examples dealing with Graph API, which is an invalid token for an API secured within my AAD
Would someone be able to modify the example below to indicate what the Client Credential Paramaters would look like below in respect of b2clogin in order to pass it an app ID, and secret, and return a token which can be used to authorise calls to the API?
Edit: this is what I am now passing to try and get a token I can use
public static string tenantID = "aadtenant.onmicrosoft.com";
public static string ClientID = "xxxx-a2e2-40f5-958b-dc39ca2bd413";
public static string Secret = "zzzzzzzzs_JhPY1HSFEREgRy5Z2rcL";
public static string redirectURI = "https://mysite.azurewebsites.net/api";
public static string[] scopes = new string[] { "api://xxxxxx-a2e2-40f5-958b-dc39ca2bd413/.default" };
public static string url = String.Format("https://login.microsoftonline.com/{0}/oauth2/v2.0/token", tenantID);
However this returns a failure
Exception AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials.
The one thing I have noticed is that when I set up API access in my AAD tenant app, only Graph is assigned. When I go to My APIs, I am not seeing anything. So I am not sure how exactly the AAD app and the B2C app relate to each other
Another edit: I have now granted a permission from the AAD app to the B2C app and created a scope but I am still getting an error, this time that the scope isn't valid