File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Setup Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 11using namespace System.Net
22
3- Function Invoke-ExecCreateSAMApp {
3+ function Invoke-ExecCreateSAMApp {
44 <#
55 . FUNCTIONALITY
66 Entrypoint,AnyTenant
@@ -19,7 +19,7 @@ Function Invoke-ExecCreateSAMApp {
1919 $URL = ($Request.headers .' x-ms-original-url' ).split(' /api' ) | Select-Object - First 1
2020 $TenantId = (Invoke-RestMethod ' https://graph.microsoft.com/v1.0/organization' - Headers @ { authorization = " Bearer $ ( $Token.access_token ) " } - Method GET - ContentType ' application/json' ).value.id
2121 # Find Existing app registration
22- $AppId = (Invoke-RestMethod ' https://graph.microsoft.com/v1.0/applications' - Headers @ { authorization = " Bearer $ ( $Token.access_token ) " } - Method GET - ContentType ' application/json' - Body " { `" filter `" : `" displayName eq 'CIPP-SAM' `" } " ).value | Select-Object - Last 1
22+ $AppId = (Invoke-RestMethod " https://graph.microsoft.com/v1.0/applications? `$ filter=displayName eq 'CIPP-SAM' " - Headers @ { authorization = " Bearer $ ( $Token.access_token ) " } - Method GET - ContentType ' application/json' ).value | Select-Object - Last 1
2323 # Check if the appId has the redirect URI, if not, add it.
2424 if ($AppId ) {
2525 Write-Host " Found existing app: $ ( $AppId.id ) . Reusing."
You can’t perform that action at this time.
0 commit comments