Description
I have the following challenge: I am in the process of rolling out an Azure AD B2C fully automatically with all user flows. For this I am creating the app registrations, the user structures, the tenant etc. via a Python script and using execute().
For the creation of a user flow I need a service principal which returns an OAuth2 token from the secret ID and the ID of the app registration (B2C context).
Via Postman I get a valid token using the rest method POST to https://login.microsoftonline.com//oauth2/token, for this I need to pass the Secrets, the ID, the GrantType, Scope and the Resource.
In my Python script, which should give me the token to modify the B2C flows via the Graph API, I use for REST requests. However, "az rest" does not give me the chance to "multipart/form-data;" bodies to pass.
Do you know any alternatives or ways like "WebkitFormData" via az-rest (POST) can send over the body with?
Description I have the following challenge: I am in the process of rolling out an Azure AD B2C fully automatically with all user flows. For this I am creating the app registrations, the user structures, the tenant etc. via a Python script and using execute().
For the creation of a user flow I need a service principal which returns an OAuth2 token from the secret ID and the ID of the app registration (B2C context).
Via Postman I get a valid token using the rest method POST to https://login.microsoftonline.com//oauth2/token, for this I need to pass the Secrets, the ID, the GrantType, Scope and the Resource.
In my Python script, which should give me the token to modify the B2C flows via the Graph API, I use for REST requests. However, "az rest" does not give me the chance to "multipart/form-data;" bodies to pass.
Do you know any alternatives or ways like "WebkitFormData" via az-rest (POST) can send over the body with?
To Reproduce Python-Command
jwt = >(f'az rest --method POST --uri "https://login.microsoftonline.com/<TENANT_ID>/oauth2/token" --skip-authorization-header --headers "multipart/form-data" --body @body/form-params.txt)
form-params.txt includes: `------WebKitFormBoundaryABCDEFGH Content-Disposition: form-data; name="grant_type"client_credentials ------WebKitFormBoundaryABCDEFGH Content-Disposition: form-data; name="client_id"