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

SignIns Unknown AppliedConditionalAccessPolicyResult #617

Closed
L4r1k opened this issue Nov 11, 2023 · 8 comments · Fixed by #630
Closed

SignIns Unknown AppliedConditionalAccessPolicyResult #617

L4r1k opened this issue Nov 11, 2023 · 8 comments · Fixed by #630
Assignees
Labels
bug Something isn't working fixed service issue Issues caused by the service (metadata/behavior)

Comments

@L4r1k
Copy link

L4r1k commented Nov 11, 2023

Hitting the SignIns list MS Graph API endpoint results in either of the following issues:

  • Unknown AppliedConditionalAccessPolicyResult value: reportOnlyFailure
  • Unknown AppliedConditionalAccessPolicyResult value: reportOnlyNotApplied

I believe this may be related to how the metadata is presenting the AppliedConditionalAccessPolicyResult, i.e. it differs from what is actually returned by the API and therefore go doesn't parse it correctly. Possibly similar to what's occurring the beta msgraph-sdk-go microsoftgraph/msgraph-beta-sdk-go#224 ?

@baywet baywet added bug Something isn't working service issue Issues caused by the service (metadata/behavior) labels Nov 13, 2023
@baywet
Copy link
Member

baywet commented Nov 13, 2023

Hi @L4r1k
Thanks for reporting this.
It seems the service is replying with enum member values that are not documented in the metadata, hence absent from this SDK.
Could you please provide the code path, or API path you're using to make the request?
@rkodev once we have that information, please open an ICM on the service team.

@L4r1k
Copy link
Author

L4r1k commented Nov 13, 2023

Sure, the main endpoint I'm hitting is client.AuditLogs().SignIns() and here's the general gist of my code (consolidated for clarity) for a bit more context:

import (
        ...
	graph "github.com/microsoftgraph/msgraph-sdk-go"
	daudit "github.com/microsoftgraph/msgraph-sdk-go/auditlogs"
)
...

headers := abstractions.NewRequestHeaders()

var filter string = fmt.Sprintf("createdDateTime ge %s and createdDateTime lt %s", startTime, endTime)
var pageSize int32 = 1000

requestParameters := &daudit.SignInsRequestBuilderGetQueryParameters{
  Filter: &filter,
  Top:    &pageSize,
}

configuration := &daudit.SignInsRequestBuilderGetRequestConfiguration{
  Headers:         headers,
  QueryParameters: requestParameters,
}

var req *daudit.SignInsRequestBuilder
req = client.AuditLogs().SignIns()
result, err := req.Get(context.Background(), configuration) // <- error occurs here

where startTime/endTime are time strings in the format of time.RFC3339. The error occurs on the first request prior to reaching the subsequent page iterator (not shown above).

As noted here, if I switch to using the beta version of msgraph-sdk, I get a different error at the same line for what I'm assuming is a similar metadata related issue. If i print out the exact request being made and hit it from curl/ms graph explorer/etc. it returns data just fine. I have looked through the package inspecting how Go parses the metadata/signin model and, as you noted, the two don't seem to line up hence my assumption that metadata is the issue. I also can't easily extract the returned data anyway as this package drops the returned data if any error occurs (result is nil) 😢

@baywet
Copy link
Member

baywet commented Nov 13, 2023

Thanks for the additional information. this is the endpoint we're referring to here. @rkodev when you have a couple of minutes, can you open an ICM on that team so they add the missing enum values or stop returning them in v1 please?

@L4r1k
Copy link
Author

L4r1k commented Nov 29, 2023

Hi, has there been any movement on this? It's a big blocker for my application 😢

@baywet
Copy link
Member

baywet commented Nov 29, 2023

Thanks for the nudge here. And for your patience. I created the ICM myself and I'll let you know about the reply from the service team.
https://portal.microsofticm.com/imp/v3/incidents/incident/446051639

@baywet
Copy link
Member

baywet commented Dec 4, 2023

Update from the ICM: the service team has made the metadata changes to include the missing enums values, they have been merged. The change is under deployment. However, those changes are only deployed weekly and we have a number of deployment freezes due to the end of the year celebrations. If that change doesn't make it in the next 2 weeks, it's likely it'll only get deployed in January.

@L4r1k
Copy link
Author

L4r1k commented Dec 4, 2023

Cheers Vincent! Thanks for your help. 🤞 it gets deployed inside 2 weeks in that case

@baywet baywet added the blocked resolving this issue is blocked by an upstream dependency label Dec 7, 2023
@baywet
Copy link
Member

baywet commented Dec 8, 2023

update from the service team: deployment complete. Which means our generation pipeline should pick it up next tuesday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed service issue Issues caused by the service (metadata/behavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants