microsoftgraph / microsoftgraph/msgraph-beta-sdk-php

Application `setOnPremisesPublishing` not working

Abierto
#356 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

dependency:metadata ToTriage type:bug
Lenguaje dominante
PHP
Estrellas
13
Forks
8
Merge medio
14 h 58 min
PR fusionados (30 d)
3

Descripción

Describe the bug

Hi,

I am trying to update an applications onPremisesPublishing configuration, which isn't working.

I have used the following guide Configure Microsoft Entra application proxy using Microsoft Graph APIs which works until the Step 2.2 where the onPremisesPublishing settings should be set/updated.

I only get the follow translated OData-Error:

InvalidJson_BadRequest : Valid JSON content expected.

Expected behavior

That the settings would be set at the MS Graph Beta API would return an 204 - No Content.

How to reproduce

I used the following code Step 2.2: Configure the onPremisesPublishing property

<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Application;
use Microsoft\Graph\Beta\Generated\Models\OnPremisesPublishing;
use Microsoft\Graph\Beta\Generated\Models\ExternalAuthenticationType;


$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);

$requestBody = new Application();
$onPremisesPublishing = new OnPremisesPublishing();
$onPremisesPublishing->setExternalAuthenticationType(new ExternalAuthenticationType('aadPreAuthentication'));
$onPremisesPublishing->setInternalUrl('https://contosoiwaapp.com');
$onPremisesPublishing->setExternalUrl('https://contosoiwaapp-contoso.msappproxy.net');
$onPremisesPublishing->setIsHttpOnlyCookieEnabled(true);
$onPremisesPublishing->setIsOnPremPublishingEnabled(true);
$onPremisesPublishing->setIsPersistentCookieEnabled(true);
$onPremisesPublishing->setIsSecureCookieEnabled(true);
$onPremisesPublishing->setIsStateSessionEnabled(true);
$onPremisesPublishing->setIsTranslateHostHeaderEnabled(true);
$onPremisesPublishing->setIsTranslateLinksInBodyEnabled(true);
$requestBody->setOnPremisesPublishing($onPremisesPublishing);

$result = $graphServiceClient->applications()->byApplicationId('application-id')->patch($requestBody)->wait();
SDK Version

v2.25.0

Latest version known to work for scenario above?

No response

Known Workarounds

I have tested around with the follow client bruno.

If I use the following body, I am able to update the settings:

{
  "@odata.type": "#microsoft.graph.application",
  "microsoft.graph.onPremisesPublishing": {    
    "@odata.type": "#microsoft.graph.onPremisesPublishing",
    "isOnPremPublishingEnabled": true
  }
}

This is the json body which is generated from the SDK:

{
  "@odata.type": "#microsoft.graph.application",
  "onPremisesPublishing": {    
    "isOnPremPublishingEnabled": true
  }
}

which was not working as I have tried it with bruno.

Even using:

{
  "@odata.type": "#microsoft.graph.application",
  "onPremisesPublishing": {    
    "@odata.type": "#microsoft.graph.onPremisesPublishing",
    "isOnPremPublishingEnabled": true
  }
}

did not worked.

There must be something "in the back" what is causing the above mentioned error.

Debug output
Configuration
  • OS: macOS Sequoia 15.1.1
  • architecture: M3 Pro
  • used PHP version:
PHP 8.3.16 (cli) (built: Jan 17 2025 01:31:19) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.16, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.16, Copyright (c), by Zend Technologies
    with Xdebug v3.4.1, Copyright (c) 2002-2025, by Derick Rethans
Other information

I have check the OpenAPI-file at github.com/microsoftgraph/msgraph-metadata/blob/master/openapi/beta/openapi.yaml and couldn't see any issue/error why this is not working 😟

Disclaimer: I know that is the beta API version 😄

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza comparando los modelos generados Application y OnPremisesPublishing con la entrada de beta openapi.yaml y los cuerpos de solicitud serializados que se muestran en el informe. Reproduce el PATCH usando SDK v2.25.0 y, a continuación, verifica que la payload emitida coincide con la solicitud funcional de Bruno y que Graph API devuelve 204 No Content.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
openapi, php
Área
api, developer-experience
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.