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

usgovernmentl4: GET /v1.0/directoryObjects/OID is missing the @odata.id field #94

Closed
manicminer opened this issue Sep 24, 2021 · 2 comments

Comments

@manicminer
Copy link

manicminer commented Sep 24, 2021

As reported in hashicorp/terraform-provider-azuread#588

The v1.0 directoryObjects endpoint is missing the @odata.id field in the response. For example:

GET /v1.0/[REDACTED]/directoryObjects/[REDACTED] HTTP/1.1
Host: graph.microsoft.us
User-Agent: HashiCorp Terraform/1.0.7 (+https://www.terraform.io) Terraform Plugin SDK/2.7.0 terraform-provider-azuread/2.2.1 Hamilton (Go-http-client/1.1) pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Accept: application/json
Content-Type: application/json; charset=utf-8
Accept-Encoding: gzip
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Cache-Control: no-cache
Client-Request-Id: 4dd395b2-8072-4190-8027-85bc6329bddd
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Date: Thu, 23 Sep 2021 13:21:27 GMT
Odata-Version: 4.0
Request-Id: 4dd395b2-8072-4190-8027-85bc6329bddd
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"USGov Arizona","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"PH1NEPF00001421"}}

{
  "@odata.context": "https://graph.microsoft.us/v1.0/$metadata#directoryObjects/$entity",
  "@odata.type": "#microsoft.graph.servicePrincipal",
  "id": "[REDACTED]",
  "deletedDateTime": null,
  "accountEnabled": true,
  "alternativeNames": [],
  "appDisplayName": "[REDACTED]",
  "appDescription": null,
  "appId": "[REDACTED]",
  "applicationTemplateId": null,
  "appOwnerOrganizationId": "[REDACTED]",
  "appRoleAssignmentRequired": false,
  "createdDateTime": "2020-12-04T14:48:53Z",
  "description": null,
  "disabledByMicrosoftStatus": null,
  "displayName": "[REDACTED]",
  "homepage": null,
  "loginUrl": null,
  "logoutUrl": null,
  "notes": null,
  "notificationEmailAddresses": [],
  "preferredSingleSignOnMode": null,
  "preferredTokenSigningKeyThumbprint": null,
  "replyUrls": [],
  "resourceSpecificApplicationPermissions": [],
  "samlSingleSignOnSettings": null,
  "servicePrincipalNames": [
    "[REDACTED]"
  ],
  "servicePrincipalType": "Application",
  "signInAudience": "AzureADMyOrg",
  "tags": [
    "WindowsAzureActiveDirectoryIntegratedApp"
  ],
  "tokenEncryptionKeyId": null,
  "verifiedPublisher": {
    "displayName": null,
    "verifiedPublisherId": null,
    "addedDateTime": null
  },
  "addIns": [],
  "appRoles": [],
  "info": {
    "logoUrl": null,
    "marketingUrl": null,
    "privacyStatementUrl": null,
    "supportUrl": null,
    "termsOfServiceUrl": null
  },
  "keyCredentials": [],
  "oauth2PermissionScopes": [],
  "passwordCredentials": []
}
@carlosdzrz
Copy link

This issue also occurs on other Azure plans & regions. I paste my error:

`[INFO] provider.terraform-provider-azuread_v2.0.1_x5.exe: 2021/12/10 23:31:33
[DEBUG] Begin AzureAD Response for GET https://graph.microsoft.com/v1.0/[REDACTED]/directoryObjects/[REDACTED]:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Cache-Control: no-cache
Client-Request-Id: 163c704a-cd1a-49b4-936d-e5ea447f143a
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Date: Fri, 10 Dec 2021 22:31:32 GMT
Odata-Version: 4.0
Request-Id: 163c704a-cd1a-49b4-936d-e5ea447f143a
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"DU2PEPF0000BEFD"}}

{
@odata.context : https://graph.microsoft.com/v1.0/$metadata#directoryObjects/$entity
@odata.type : #microsoft.graph.user
id : [REDACTED]
businessPhones : {}
displayName : [REDACTED]
givenName : [REDACTED]
jobTitle : null,
mail : [REDACTED]
mobilePhone : null,
officeLocation : null,
preferredLanguage : null,
userPrincipalName : [REDACTED]
surname : [REDACTED]
}`

@manicminer
Copy link
Author

Since the odata.id annotation can be retrieved by specifying the odata.metadata=full Accept header directive, so closing this in favor of the more descriptive issue #330

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

2 participants