Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scope update via application patch function not working #2293

Open
dma-1 opened this issue Feb 7, 2025 · 3 comments
Open

scope update via application patch function not working #2293

dma-1 opened this issue Feb 7, 2025 · 3 comments
Assignees
Labels

Comments

@dma-1
Copy link

dma-1 commented Feb 7, 2025

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_
@dma-1 dma-1 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Feb 7, 2025
@aappddeevv
Copy link

In 6.x, I can't get the patch operation on Applications to work at all either. I think this is a general problem. My return value from the patch call is 204 as well, but no changes in the application object in the cloud.

@dma-1
Copy link
Author

dma-1 commented Feb 10, 2025

@aappddeevv thanks for your reply.
Did you try the 6.16.0 version? On that version the patch still seems to work (for us at least).

@aappddeevv
Copy link

aappddeevv commented Feb 15, 2025

Not yet, I'll try it. You may want to see my other bug entry. I think something stateful is going on behind the scenes.

@andrueastman andrueastman self-assigned this Feb 19, 2025
@andrueastman andrueastman added Status: Needs Investigation and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants