Skip to content

Commit

Permalink
correct msgraph search query - fixes #189
Browse files Browse the repository at this point in the history
  • Loading branch information
sspans-sbp committed Apr 24, 2024
1 parent e660c4f commit b364b84
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit b364b84

Please sign in to comment.