Problem registering custom membership provider
Some time ago (GCX 3.15) I experimented with a custom MembershipProvider. This worked ok, and now I want to do the same thing with GCX 4.1. However, some things have changed since, and now I can't get my provider registered and show up in the Security | Providers screen of the Manager.
If I understand things correctly, all I need to do is to add a reference to my provider to membership.config (used to be 'asset.config' in earlier versions), and add a reference to a roleprovider to rolemanager.config (I'm not sure if a rolemanager is strictly neccesary, I tried both with and without). Then I restarted the IdentityServer apppool, but nothing changed. I'm not even getting an error message, or something in the logfile.
The strange thing is, I'd expect membership.config to be read, at least, but when I use (https://technet.microsoft.com/en-us/sysinternals/bb896645) Process Monitor , that file isn't even accessed. This leads me to believe I'm missing a configuration step, but I have no idea what that is.
-
It seems I was missing some of the basic concepts of Geocortex Identity Server: As far as I can see now, the Geocortex Identity Server uses only a single membership provider out of the list of providers configured in membership.config. This provider should be declared as the 'defaultProvider' in the membership tag. Some providers come with the installation, e.g. the legacy XML provider and the Active Directory Provider. It is possible to add your own provider to the list and use it, just copy the assembly to the Web\bin folder.
Some notes that may be of help to others:
- On the Security | Providers page in the manager, the Geocortex Identity Server should be enabled.
- Unlike me, do not try to use Geocortex.Logging anywhere in a custom membership provider. That assembly is not included with the Identity Server, so things will fail with no clear identification of what goes wrong.
- Inside the ValidateUser method, use a big fat try-catch and log any error messages somewhere. This will help a lot to figure out what exactly goes wrong on a server. I'm not sure what the cleanest options is, for debugging purposes I now just use File.AppendAllText() to a file in a temporary folder, but I'm sure better methods exist.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar