7/04/2012

UserPrincipal.Current Throws Error “The specified directory service attribute or value does not exist”

My ASP.NET page (windows authentication, impersonation) uses UserPrincipal.Current to get information about the active user.

Getting this property executes an LDAP query to Active Directory.

Now with some browsers I get an error message “The specified directory service attribute or value does not exist”.

Using WireShark I figured out that Kerberos authentication did not work between the web server and AD, which is a sign that the browser did not pass a Kerberos ticket in the first place.

I pinned this down to two reasons:

Internet Explorer

in IE the problem was that the site was not in the “Intranet” zone. Adding it to this zone fixed the problem.

Firefox

There are two essential settings:
•    network.negotiate-auth.delegation-uris
•    network.negotiate-auth.trusted-uris

If you set both to the domain (or full name) of your server, Kerberos authentication will work.

 

I hope this saves someone else the two days that it took me to figure out where the problem was.

6/12/2012

Umgang mit Personaldaten im Zug

Es ist schon erstaunlich, wie manche Personaler mit den Daten ihrer Angestellten umgehen: heute stand ich hinter jemandem, der ohne jeglichen Sichtschutz (soll es ja als Zubehör geben) am Laptop ungeniert Kündigungsbriefe und Abmahnungen durchsah und neue schrieb. Die Namen der Angestellten waren gut lesbar.

Ach ja, die Firma war übrigens die BBV-Service Versicherungsmakler GmbH. Vielleicht sollte dort ja jemand diesem Personaler eine Kündigung schreiben?

4/09/2012

Günter Grass Persona Non Grata in Israel

Egal wie man nun zu dem Gedicht stehen mag, es fällt mal wieder auf, dass der Staat Israel sich bei Auseinandesetzungen mit seiner Politik stets mit dem Volk Israel gleichsetzt. Das macht es dann schön einfach, jedem Deutschen zu sagen “Sei still, senk daran was bei Euch im dritten Reich geschah”.

Man kann durchaus Juden als Freunde haben und dennoch die Politik des Staates Israel verurteilen, denn der Staat Israel ist eben nicht das Volk Israel!

So, und zur Politik des Staates Israel äußere ich mich jetzt nicht, sonst habe ich dort auch Einreiseverbot.

Das Gedicht (warum nennt es sich eigentlich “Gedicht”, für mich ist es mehr ein Prosa-Text, vgl. http://www.spiegel.de/kultur/gesellschaft/0,1518,825744,00.html) empfinde ich in den meisten Aussagen als durchaus nachvollziehbar. Ups, zu viel gesagt? Ich böser Deutscher …

4/03/2012

Don’t Trust your Software Engineer!

I saw a thread here http://social.msdn.microsoft.com/Forums/en-ZA/wspdev/thread/84003ac0-89fd-426e-9770-e132cd6f5f7a that I found quite interesting:

Someone asks a question why certain settings are stored in applicationHost.config instead of Web.config.

Then there is a very good answer, but the person who asked does not understand it, because “Sorry I am not a .net developer”.

OK, so why does he ask a programmer’s question then?

Here’s why: “I am really asking this for the purpose of instructing our developer accordingly.”

Oops, looks like someone does not trust his developer! Wouldn’t it be better to ask the programmer to do the necessary research?

Guess how the programmer will react to a half-wit* trying to tell him how he should do his job?

Don’t you just love this style of micro-management and distrust?

 

 

* half-wit regarding programming only, of course!
Oh well, any maybe also regarding inspiring responsibility in people, social interaction, delegation, … Actually, a half-wit in terms of people management.

3/08/2012

John Lennon 'suffered bulimia'

According to this article in The Telegraph, John Lennon suffered from bulimia: http://www.telegraph.co.uk/culture/music/the-beatles/9126443/John-Lennon-suffered-bulimia.html

So, is there where the famous lines originated from: “All we are saying, is give peas a chance”?

But frankly, I wouldn’t have been able to keep my food in either, with Yoko Ono singing next to me …

2/29/2012

Error 0x8000500c When Using UserPrincipal.Current

Problem

I was getting the following error on one of my ASP.NET sites:

Message: Unknown error (0x8000500c)
Source: System.DirectoryServices
Stack: at System.DirectoryServices.PropertyValueCollection.PopulateList()
at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName)
at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)
at System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInitNoContainer()
at System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit()
at System.DirectoryServices.AccountManagement.PrincipalContext.Initialize()
at System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx()
at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable`1 identityType, String identityValue, DateTime refDate)
at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, IdentityType identityType, String identityValue)
at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, IdentityType identityType, String identityValue)
at System.DirectoryServices.AccountManagement.UserPrincipal.get_Current()





Sometimes, the error read slightly differently as




Message: The specified directory service attribute or value does not exist.

Source: System.DirectoryServices
Stack: at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_SchemaEntry()
at System.DirectoryServices.AccountManagement.ADStoreCtx.IsContainer(DirectoryEntry de)
at System.DirectoryServices.AccountManagement.ADStoreCtx..ctor(DirectoryEntry ctxBase, Boolean ownCtxBase, String username, String password, ContextOptions options)
at System.DirectoryServices.AccountManagement.PrincipalContext.CreateContextFromDirectoryEntry(DirectoryEntry entry)
at System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInitNoContainer()
at System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit()
at System.DirectoryServices.AccountManagement.PrincipalContext.Initialize()
at System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx()
at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable`1 identityType, String identityValue, DateTime refDate)
at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, IdentityType identityType, String identityValue)
at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, IdentityType identityType, String identityValue)
at System.DirectoryServices.AccountManagement.UserPrincipal.get_Current()





This happened in a call to UserPrincipal.Current.



Root Cause



This seems to be due to a double-hop problem: the browser connects to IIS, then IIS tries to connect to AD. I am using Integrated Authentication and Impersonation, which means that IIS will use the current user’s credentials to connect to AD, but it doesn’t have the user’s password (it would have, and it would work if I enable basic authentication), nor does it seem to have a Kerberos ticket, which would be forward-able.



Solution



I found out that the reason no Kerberos ticket was being used was due to IE thinking my site was an Internet site. As soon as I had marked it as an Intranet site, everything worked fine.



If you have the same problem, you can quickly verify whether you are facing the same double-hop issue: turn off integrated auth, and turn on basic, then try again. Or access you web site from the same machine that runs IIS, which also avoids the double hop.



I am not sure, which particular security setting comes into my way, but simply “moving” the site to Local Intranet for IE solves the issue.

1/11/2012

Download Broadcasts from BBC’s iPlayer via a Proxy

If you read this, you are probably located outside the UK and already familiar with using a proxy to access the iPlayer web site to watch BBC broadcasts.

Now, sometimes you’ll want to download a movie to view later. After some research I found a tool named get_iplayer for this purpose, you can get it here – both Linux and Windows versions are available.

If you are running Windows, make sure to get the setup program, as there are a few additional programs required for conversion; the setup program install these automatically. (Or might want to choose to grab this opportunity to migrate to Linux :-))

get_iplayer  is a command line tool, but easy enough to use even for Windows users once you have checked all the options. You actually do need only a few of them.

If you are not in the UK, this tool can use an http proxy, which is very convenient.

1/06/2012

Santander – Spass beim Online Banking

Bei Santander musste ich letztens mein Online-Passwort ändern. Eigentlich eine einfache Sache, aber nicht hier:

Schön war die Angabe, wie lang das Passwort sein sollte, und welche Zeichen erlaubt sind. Später erführ ich allerdings von der Hotline, dass man “besser keine Sonderzeichen” verwenden solle, damit gebe es Probleme, auch mit Zahlenfolgen wie “111” oder “123”.

Nun, mein Passwort wurde akzeptiert, ich sollte die Änderung mit einer TAN bestätigen. Und hier unterlief mir der entscheidende Fehler: ich habe aus der Liste die falsche TAN herausgesucht, dreimal eingegeben und die Liste war gesperrt.

Kein Problem, das Online Banking versprach, dass sofort eine neue Liste versendet würde. Das war im November – im Dezember hatte ich immer noch keine Liste.

Aber es gibt ja noch den Antrag per Fax – ausgefüllt und abgeschickt. Das war Anfang Dezember, im Januar habe ich immer noch keine Liste.

Ein Versuch per email scheiterte ebenfalls, es kam nicht einnmal die verlangte Lesebestätigung zurück, geschweige denn eine Antwort.

Und so wandte ich mich an die freundliche Hotline zu 14 ct/min – nur um erstmal eine Minute lang Werbung für neue Santander-Produkte zu hören – kostenpflichtige Werbung wohlgemerkt!

Danach folgen noch zwei Minuten Maschinen-Interaktion (Kontonummer eingeben, Geheimzahl, Menüauswahlen).

Endlich bei einem Menschen angelangt sagte man mir, dass keinerlei Information vorliegen, dass ich eine neue Liste beantragt hätte! Steht bei Santander das Fax direkt vor dem Reisswolf?

Ich solle das Ganze nochmal probieren, was wie erwartet mit der Meldung “TAN Liste gesperrt” endete. Nun endlich wollte man mir endlich eine neue Liste erstellen.

Ingesamt war der Anruf 10 Minuten lang gewesen, also 1,40€, die ich zahle, wobei die Probleme bei Santander liegen. Es geht mir weniger um den Betrag als ums Prinzip!

Aber immerhin bekomme ich die Liste ohne zusätzliche Gebühren – wie nett.

In einer Woche soll sie da sein – ich bin schon gespannt ob es diesmal klappt.

Dass ich seit zwei Monaten keinen Zugriff auf mein Geld habe, interessierte wohl niemanden.

adaxas Web Directory