Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting SignInAudiences in aadb2c-create-test-webapp.ps1 fails. #2

Open
b3nt0 opened this issue Aug 18, 2020 · 2 comments
Open

Setting SignInAudiences in aadb2c-create-test-webapp.ps1 fails. #2

b3nt0 opened this issue Aug 18, 2020 · 2 comments

Comments

@b3nt0
Copy link

b3nt0 commented Aug 18, 2020

@cljung

I'm getting an error from the HTTP PATCH operation at the end of "aadb2c-create-test-webapp.ps1".

Error output is:

Invoke-RestMethod : { "error": { "code": "InvalidAccessTokenVersion", "message": "One or more properties contains invalid values.", "innerError": { "date": "2020-08-18T12:49:22", "request-id": "bcc86468-903d-4e7f-8f57-9e558b8f8bab" } } } At C:\Users\joshu\source\repos\test\aadb2c-create-test-webapp.ps1:71 char:1 Invoke-RestMethod -Uri $apiUrl -Headers @{Authorization = "Bearer $($ ...

I've tried different values for the URL's including the beta graph endpoint and v2 token endpoint. I should also mention that I've created a new tenant and followed the getting started instructions.

I didn't think that it was even possible to set the value of SignInAudiences to the value of "AzureADandPersonalMicrosoftAccount" without going through the portal?

@b3nt0 b3nt0 changed the title Setting SignInAuience in aadb2c-create-test-webapp.ps1 fails. Setting SignInAudiences in aadb2c-create-test-webapp.ps1 fails. Aug 18, 2020
@b3nt0
Copy link
Author

b3nt0 commented Aug 19, 2020

I was able to find a solution.

The $body variable at the bottom of the script that is included in the PATCH request needs to look like this:

$body = @{ api = @{ requestedAccessTokenVersion = 2 } SignInAudience = "AzureADandPersonalMicrosoftAccount" }
Once that has been included you can create a B2C application successfully.

This was obnoxiously hard to find. Just saying.

@thewisenerd
Copy link

using the azure CLI, please ignore this comment if irrelevant,

az rest --method PATCH --uri "https://graph.microsoft.com/v1.0/applications(appId='xx')" --body '{"api": {"requestedAccessTokenVersion": 2}, "signInAudience":"AzureADandPersonalMicrosoftAccount"}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants