While working on #6565, I noticed we're currently not supporting all types of apps that can be created in the Entra ID portal. Or at least, not in a simple way....:
- iOS / macOS
- Android
These are effectively publicClients, and could be configured already, but the required redirectUri values are not easy to remember.
The iOS/macOS platform would need the following redirectUris:
msauth://code/msauth.<bundleId>%3A%2F%2Fauth, msauth.<bundleId>://auth
The android platform would need:
msauth://<bundleId>/<signatureHash>
To make adding such a platform easier I propose the following change in options:
| Option |
Description |
-p, --platform [platform] |
Platform for which the app should be configured. Allowed values spa, web, publicClient, apple, android. |
--bundleId [bundleId] |
Specify a bundle Id to add the iOS / macOS or Android platform to the application. Required when platform is apple or android. |
--signatureHash [signatureHash] |
A required hash when specifying a bundle Id and platform android. |
Remarks
When specifying platform apple, the option bundleId is required.
When specifying platform android, the options bundleId and signatureHash are required.
When specifying platforms spa, web or publicClient, the option redirectUris is required.
Examples
Create new Entra app registration for an iOS app
m365 entra app add --name 'My Entra app' --platform apple --bundleId 'com.contoso.app'
Create new Entra app registration for an Android app
m365 entra app add --name 'My Entra app' --platform android --bundleId 'com.contoso.app' --signatureHash '2pmj9i4rSx0yEb/viWBYkE/ZQrk='
Implementation details
iOS / macOS
When adding a bundle identifier, two redirectURI's should be added to the publicClient > redirectUris part of the App manifest. The below example is based on a bundle identifier com.contoso.app:
"publicClient": {
"redirectUris": [
"msauth://code/msauth.com.contoso.app%3A%2F%2Fauth",
"msauth.com.contoso.app://auth",
]
},
Android
When adding a bundle Identifier and a signature hash, the following redirectUri should be added to the publicClient > redirectUris part of the App manifest. The below example is based on a bundle identifier com.contoso.app and the signature hash 2pmj9i4rSx0yEb/viWBYkE/ZQrk=
"publicClient": {
"redirectUris": [
"msauth://com.contoso.app/2pmj9i4rSx0yEb%2FviWBYkE%2FZQrk%3D",
]
},
While working on #6565, I noticed we're currently not supporting all types of apps that can be created in the Entra ID portal. Or at least, not in a simple way....:
These are effectively publicClients, and could be configured already, but the required redirectUri values are not easy to remember.
The iOS/macOS platform would need the following redirectUris:
msauth://code/msauth.<bundleId>%3A%2F%2Fauth,msauth.<bundleId>://authThe android platform would need:
msauth://<bundleId>/<signatureHash>To make adding such a platform easier I propose the following change in options:
-p, --platform [platform]spa,web,publicClient,apple,android.--bundleId [bundleId]appleorandroid.--signatureHash [signatureHash]android.Remarks
When specifying platform
apple, the optionbundleIdis required.When specifying platform
android, the optionsbundleIdandsignatureHashare required.When specifying platforms
spa,weborpublicClient, the option redirectUris is required.Examples
Create new Entra app registration for an iOS app
Create new Entra app registration for an Android app
Implementation details
iOS / macOS
When adding a bundle identifier, two redirectURI's should be added to the publicClient > redirectUris part of the App manifest. The below example is based on a bundle identifier
com.contoso.app:Android
When adding a bundle Identifier and a signature hash, the following redirectUri should be added to the publicClient > redirectUris part of the App manifest. The below example is based on a bundle identifier
com.contoso.appand the signature hash2pmj9i4rSx0yEb/viWBYkE/ZQrk=