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

Azure AD SCIM Provisioning content type is not set to application/scim+json #94189

Closed
kwent opened this issue Jun 9, 2022 · 5 comments
Closed

Comments

@kwent
Copy link

kwent commented Jun 9, 2022

Azure AD SCIM Provisioning content type is not set to application/scim+json

Service: Azure AD
Doc: https://docs.microsoft.com/en-us/azure/active-directory/app-provisioning/use-scim-to-provision-users-and-groups#get-user

Screen Shot 2022-06-09 at 1 56 37 PM

While testing SCIM and clicking on Test connection button. Request is sent without a content-type set to application/scim+json. Most of application will respond with a 406 Not Acceptable

Started GET "/scim/Users?filter=userName+eq+%227d420df3-9995-4831-a406-ecf8166f5f6a%22" for 40.126.25.32 at 2022-06-09 13:52:57 -0700
Cannot render console from 40.126.25.32! Allowed networks: 216.181.76.143, 47.185.130.74, 73.241.204.197, 127.0.0.0/127.255.255.255, ::1
Processing by Public::Scim::UsersController#index as HTML
  Parameters: {"filter"=>"userName eq \"7d420df3-9995-4831-a406-ecf8166f5f6a\""}
Completed 406 Not Acceptable in 143ms (Views: 4.8ms | ActiveRecord: 0.0ms | Allocations: 163348)

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@JamesTran-MSFT
Copy link
Contributor

@kwent
Thank you for your feedback! To better understand and route your issue, can you share the documentation that you're referencing when creating this issue?

@kwent
Copy link
Author

kwent commented Jun 10, 2022

Added the doc. The problem is wider. Any request made by Azure AD to scim endpoints doesn't have content type application/scim+json as referenced in https://datatracker.ietf.org/doc/html/rfc7644#section-3

@ZollnerdMSFT
Copy link
Contributor

Hi - I'm a product manager here at Microsoft and work on our SCIM client and provisioning service. We've looked into this and things are working as expected both by our design and by the requirements of the spec. Key things to call out:

  1. The test credentials action you initially reference is a GET - there is no body to the request, therefore no content-type header is required
  2. The SCIM protocol spec (RFC 7644) states in section 3.8 that the content type/data format defaults to application/scim+json if no value is provided
  3. On requests where our provisioning service does provide a body (i.e.: a POST or PATCH with details being provided in a JSON object in the body) we do include the content-type header, even though it is optional as pointed out above

@JamesTran-MSFT
Copy link
Contributor

@kwent
Since our SCIM client and provisioning service is working as expected, I'll go ahead and close out this issue. If you're still running into problems, I'd recommend working closer with our support team via an Azure support request. Or you can leverage our Q&A forum by posting your issue there so our community, and MVPs can further assist you in troubleshooting your issue or finding potential workarounds.

Thank you again for your time and patience throughout this issue.

@pond
Copy link

pond commented Jun 14, 2022

The test credentials action you initially reference is a GET - there is no body to the request, therefore no content-type header is required

This makes sense and is in line with GET examples in RFC 7644 which contain no Content-Type header in the request, compared with all other examples for other HTTP methods where the header is included. If that's how Azure AD behaves, it should be fine.

The SCIM protocol spec (RFC 7644) states in section 3.8 that the content type/data format defaults to application/scim+json if no value is provided

It's a minor point, but that is incorrect. https://datatracker.ietf.org/doc/html/rfc7644#section-3.8 is clearly talking about the Accept header when it makes that reference. The statement does not apply to Content-Type.

When it comes to Content-Type, the HTTP specification itself talks about that; it's technically not mandatory, but processing systems would have to guess the content type otherwise and default to application/octet-stream if they can't. It seems reasonable to just require and assume that this is the content type inbound when handling SCIM endpoint requests as an API implementor, since a JSON parser used therein has to be robust against potential fuzzing attacks regardless - the presence of the header could hardly be trusted by itself in any case.

On requests where our provisioning service does provide a body (i.e.: a POST or PATCH with details being provided in a JSON object in the body) we do include the content-type header, even though it is optional as pointed out above

Yes, this is good and I'd argue there's almost no excuse for not doing so when consuming SCIM APIs.

Thanks for the detailed explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment