microsoftgraph / microsoftgraph/msgraph-sdk-java

scope update via application patch function not working

Aperta
#2,293 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@andrueastman ci sta già lavorando.

Dal 19/2/2025.

Status: Needs Investigation type:bug
Lingua principale
Java
Stelle
444
Fork
154
Merge medio
18h 28m
PR unite (30g)
4

Descrizione

Describe the bug

Since updating to Microsoft Graph SDK version 6.17.0, our functions for updating/patching an application's 'oauth2PermissionScopes' seem to be failing in our Kotlin app.

Java Version: 17
Kotlin Version: 2.1.0

For example, if I try to change the 'oauth2PermissionScopes' name from "Files.Read" to "Directory.Read," the response from the 'Application patch' function is null. I assume this is a good sign since, when I debug and intentionally cause an error, such as by using an incorrect application ID (or object ID), I do receive an error response.

executed code to patch application:

fun updateApplication(app: Application) {
        try {
            graphServiceClient.applications()
                .byApplicationId(app.id)
                .patch(app)
        } catch (e: ApiException) {
            ...
        }
    }

applicationToUpdate.api.oauth2PermissionScopes JSON object:

[
  {
    "id": "1234abcd-12ab-12ab-12ab-123456abcdef",
    "name": "Files.Read",
    "type": "User",
    "consentDisplayName": "Read your files",
    "consentDescription": "Allows the application to read your directories"
  }
]

However, when using version 6.16.0, the application’s 'oauth2PermissionScopes' are updated successfully after calling the patch function. In contrast, when performing the same operation with version 6.17.0, the 'oauth2PermissionScopes' remain unchanged (in this case, still showing "Files.Read").

Expected behavior

I'd expect, that the 'oauth2PermissionScopes' would be updated the same as in version '6.16.0'.

How to reproduce
  1. search a test application
  2. create an application object of the test application
  3. change the oauth2PermissionScopes name
  4. run the application patch function using the object id you copied and the application object copy you created
SDK Version

=> 6.17.0

Latest version known to work for scenario above?

6.16.0

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.