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

correct msgraph search query - fixes #189 #196

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ func NewMSGraphClient(graphURI string, creds azcore.TokenCredential) (*MSGraphCl
return ac, nil
}

func (c *MSGraphClient) GetApplication(ctx context.Context, clientID string) (Application, error) {
filter := fmt.Sprintf("appId eq '%s'", clientID)
func (c *MSGraphClient) GetApplication(ctx context.Context, applicationObjectID string) (Application, error) {
filter := fmt.Sprintf("Id eq '%s'", applicationObjectID)
req := applications.ApplicationsRequestBuilderGetRequestConfiguration{
QueryParameters: &applications.ApplicationsRequestBuilderGetQueryParameters{
Filter: &filter,
Expand All @@ -91,7 +91,7 @@ func (c *MSGraphClient) GetApplication(ctx context.Context, clientID string) (Ap
return Application{}, fmt.Errorf("no application found")
}
if len(apps) > 1 {
return Application{}, fmt.Errorf("multiple applications found - double check your client_id")
return Application{}, fmt.Errorf("multiple applications found - double check your Application Object ID")
}

app := apps[0]
Expand Down