Hi the custom policy gets called with the client id of the B2C app
https://login.microsoftonline.com/TENANT/oauth2/v2.0/authorize?p=B2C_1A_POLICY&client_id=THE-
Ok its a bit of a work around but I tried with a standard UserJourneyContextProvider technical profile and this didnt work
so to get the client id as a claim I did the following
Create an orchestration step
Then create a RESTFUL technical profile which will call a Function App passing the OIDC with the {OIDC:ClientID}
Get-ClientID-FromOIDC
- None
- --FUNCTION APP URL--
- QueryString
And then finally create a function app which accepts the client id from the querystring and returns it with the correct format for B2C to identify
using System.Net; using System.Net.Http.Formatting;
public static async Task Run(HttpRequestMessage req,
TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
// parse query parameter
string client_id = req.GetQueryNameValuePairs()
.FirstOrDefault(q => string.Compare(q.Key, "client_id", true) == 0)
.Value;
return req.CreateResponse(
HttpStatusCode.OK, new ResponseContent
{
version = "1.0.0",
status = (int) HttpStatusCode.OK,
client_id = client_id
},
new JsonMediaTypeFormatter(), "application/json");
}
class ResponseContent {
public string version;
public int status;
public string client_id;
}
You will now get the B2C application client_id as a claim in the claim bag so you can do what you want with it now