I have created the native console application using below code and also created the service principal. However not able to generate the token unless I modify the application from new/old azure portal.
$app = New-AzureADApplication `
-AvailableToOtherTenants 1 `
-DisplayName $NativeAppName `
-HomePage $NativeAppIdentifierUri `
-IdentifierUris $UiIdentifierUri `
-PublicClient 1 `
-ReplyUrls $replyUrls `
-RequiredResourceAccess $requiredResources
$app_principal = New-AzureADServicePrincipal -AppId $app.AppId -Tags @($NativeAppName + ' Principal')
Seems like issue with consenting the application. Why does application doesn't get consented? Does native application needs to be consented with tenant itself?