Error creating a sitecollection when using custom claims providers

Just came across a problem where the creation of a site collection would fail with no real informative error message. If you are using custom claims providers you might be running into the situation described in Steve Peschka’s blog:

https://blogs.technet.com/b/speschka/archive/2010/11/15/problems-resolving-claims-names-in-sharepoint-2010.aspx

Most probably the problem is that the claims provider doesn’t handle the user “NT AUTHORITY\authenticated users” well.