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

ProvisionOnDemand() in SynchronizationJobClient returns error even though provisioning was successful #203

Open
ken5scal opened this issue Jan 3, 2023 · 0 comments

Comments

@ken5scal
Copy link

ken5scal commented Jan 3, 2023

SynchronizationJobClient ProvisionOnDemand() returns non-nil error although both logs and admin console declares provisioning has been successful .

my code

        jobs, _, err := syncJobClient.List(ctx, request.ServicePrincipalId)
	if err != nil {
		return fmt.Errorf("failed to get job from app(%v): %v", request.ServicePrincipalId, err)
	}
	ruleId := {RULE_ID}
	objType := "User"
	param := &msgraph.SynchronizationJobProvisionOnDemand{
		Parameters: &[]msgraph.SynchronizationJobApplicationParameters{{
			RuleId: &ruleId,
			Subjects: &[]msgraph.SynchronizationJobSubject{{
				ObjectId:       request.User.ID(),
				ObjectTypeName: &objType}},
		}},
	}
	if _, err := syncJobClient.ProvisionOnDemand(ctx, *(*jobs)[0].ID, param, request.ServicePrincipalId); err != nil {
		return fmt.Errorf("failed provisioning user(%v) to app(%v): %v", *request.User.ID(), request.ServicePrincipalId, err)
	}

admin console

image

Logs

SynchronizationJobClient.BaseClient.Post(): unexpected status 200 with response: {"@odata.context":"https://graph.microsoft.com/beta/$metadata#microsoft.graph.stringKeyStringValuePair","key":"Microsoft.Identity.Health.CPP.Common.DataContracts.SyncFabric.StatusInfo","value":"[{\"provisioningSteps\":[{\"name\":\"EntryImport\",\"type\":\"Import\",\"status\":\"Success\",\"description\":\"Retrieved User ' ' from Azure Active Directory","timestamp":"2023-01-03T03:21:28.5276533Z","details\”:HIDDEN},{"name":"EntryImport","type":"Matching","status":"Success","description":"Retrieved '[email protected]' from Google Cloud / Workspace","timestamp":"2023-01-03T03:21:29.3960403Z","details\”: HIDDEN,{"name":"EntrySynchronizationScoping","type":"Scoping","status":"Success","description":"Determine if User in scope by evaluating against each scoping filter","timestamp":"2023-01-03T03:21:29.4160394Z","details":{"Active in the source system":"True","Assigned to the application":"True","User has the required role":"True","Scoping filter evaluation passed":"True","ScopeEvaluationResult":"{}"}},{"name":"EntryExportUpdate","type":"Export","status":"Success","description":"User '[email protected]' was updated in Google Cloud / Workspace","timestamp":"2023-01-03T03:21:30.6197578Z","details":{}},{"name":"EntryExportUpdate","type":"Export","status":"Success","description":"User '[email protected]' was updated in Google Cloud / Workspace","timestamp":"2023-01-03T03:21:30.6237579Z","details":{}}],"modifiedProperties":[{"displayName":"emails.[type eq \"work\"].address","oldValue":null,"newValue":"[email protected]"}],"action":"Update","changeId":"4f9f0d6a-b8e0-4069-b0e2-a24ff5d578ff","endTime":"2023-01-03T03:21:30.6267623Z","reportableIdentifier":"[email protected]","sourceIdentity":{"id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","type":"User","name":null,"details":null},"sourceSystem":{"id":null,"name":"Azure Active Directory","details":null},"startTime":"2023-01-03T03:21:28.5206543Z","statusInfo":{"status":"Success","errorCode":null,"reason":null,"additionalDetails":null,"errorCategory":null,"recommendedAction":null},"targetIdentity":{"id":"104020537153314748066","type":"User","name":null,"details":null},"targetSystem":{"id":null,"name":"Google Cloud / Workspace","details":null}}]"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant