Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

Use az ad app create to creata a SPA #21476

Open alexander-kastil opened 2 years ago

alexander-kastil commented 2 years ago

Could you please provide a sample on how to create an app registration of type SPA. When using:

az ad app create --display-name $app-ui --required-resource-accesses @manifest-ui.json \ --oauth2-allow-implicit-flow false \ --reply-urls $urlUI --query appId -o tsv

the resulting replyUrlsWithType is always

"replyUrlsWithType": [ { "url": "http://localhost:4200", "type": "Web" } ],

instead of

"replyUrlsWithType": [ { "url": "http://localhost:4200", "type": "Spa" } ],

This results in error: Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type.

Can you please comment on how to create other platform types than web. Thank you


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

yonzhan commented 2 years ago

@jiasli for awareness

jiasli commented 2 years ago

Please see https://github.com/Azure/azure-cli/issues/9501#issuecomment-610979930 for a the Microsoft Graph approach.

Meanwhile, we will publish the first beta version using Microsoft Graph shortly at https://docs.microsoft.com/cli/azure/microsoft-graph-migration. You are very welcome to test it and give us your feedback. 😉

alexander-kastil commented 2 years ago

@jiasli thanks that helped ... I actually found this post before but did not take the time to try it out because there were so many posts to try ... I think for less experienced users it would be great to have some kind of application type switch in the azure cli

benc-uk commented 1 year ago

Why is this closed

It's not resolved or fixed, there's still no way to create a SPA app using the CLI without some frankly pretty nasty workarounds

alexander-kastil commented 1 year ago

@benc-uk I closed it because for a long time it seemed that nobody else cared

benc-uk commented 1 year ago

Apologies I thought it had been closed by one of the Azure CLI team

MatthiasThurnbauer commented 4 months ago

Are there any updates to that? Seems strange that there are only options for creating web or public client app registrations but not for SPAs

Expecho commented 4 months ago

@benc-uk is this on the roadmap somewhere? Its very annoying we can't totally script our application because of this missing feature.

benc-uk commented 4 months ago

@benc-uk is this on the roadmap somewhere? Its very annoying we can't totally script our application because of this missing feature.

I work for Microsoft but I'm not part of the Azure CLI team But I think it's insane this hasn't been addressed in two years, it's not like deploying a SPA to Azure is a crazy new thing anymore