"esriags" applicationName for sql server membership provider

2063
9
02-06-2013 01:24 PM
GerardoGarcia
New Contributor III
Where do I change this applicationName value which defaults to "esriags"? Im trying to use SQL server membership as security store. Thanks
Tags (2)
0 Kudos
9 Replies
nicogis
MVP Frequent Contributor
I think that it is embedded in code so it binds at applicationName = 'esriags'
0 Kudos
GerardoGarcia
New Contributor III
I think that it is embedded in code so it binds at applicationName = 'esriags'


Thanks for the feedback Domenico. You're right. Yesterday I stumbled upon a file and folder under the default arcgis server installation path (for 10.1 sp1). The path is C:\Program Files\ArcGIS\Server\framework\lib\ext. Here you will find 3 files: a single *.soe file and two *.jar files. If you open the .soe archive as a zip, you will find a few folders and files namely a "config.xml" (authored by "shre5185" :)) and AGSMembershipProvider.dll under the "Install" directory.

Using a common decompiler, I've managed to locate where the defaults are coming from: There is the "AGSMembershipProvider" namespace which contains the "AGSSqlMembershipProvider" internal class. It inherits the .net "SqlMembershipProvider" and so all it's defaults that could usually be changed in a web.config file like "requiresUniqueEmail" and "minRequiredNonalphanumericCharacters".

I've sent in a support ticket because at this point I don't know where to go from here, aside from generating my own "AGSMembershipProvider.dll" file which I'd rather not do.
0 Kudos
RyanKoehnen
New Contributor III
Gerardo, I decompiled this also and took a look. It appears all of the traditional web.config values get passed in from the JSON config with the except of applicationName, which appears to be hardcoded as "esriags".

So for example-
{
  "type": "SQL_SERVER",
  "properties": {
    "connectionString": "Data Source=machine;Initial Catalog=test_ags_security;Integrated Security=SSPI",
    "maxInvalidPasswordAttempts": "3",
    "minRequiredPasswordLength": 5
  }
}

It works in my testing. Did Esri confirm this?
0 Kudos
RuchiraWelikala
Occasional Contributor

Were you able to find a solution to this?

0 Kudos
GerardoGarcia
New Contributor III

Hello Ryan and Ruchira,

Didn't know that the new "geonet"/esri forums auto-email you on an update to an old thread! Nice feature. I would've responded sooner to Ryan's questions but I haven't returned back to this problem since my last post here.

So, unfortunately, I never found a solution to this. We ended up using ArcGIS built-in users/roles but I've used a proxy with a generic arcgis user account that has privileges to the needed services.

I imagine that a custom dll/MembershipProvider can be created which could be based off of the SqlMembershipProvider which would allow you to change the "applicationName" attribute (and any others), but for whatever reason, esri hard-coded it. If you care to find a solution, I would recommend investigating the above suggestion (creating custom provider).

I'm still using server 10.1 sp1 so I don't know if this has changed in any newer releases, but I'll find out later. Plus, the ASP.NET folk have released newer/enhanced membership providers in the past couple of years that should be better (bing or google for asp.net Identity provider).

If you do find a solution, I'd ask for you to post here (if you don't mind). Thanks guys.

0 Kudos
RuchiraWelikala
Occasional Contributor

Thanks for your reply, Gerado.

I'm trying to figure this out for 10.2.2 right now and they still seem to have the applicationName hardcoded. Pretty annoying. We have a large number of users stored in a SQL Server database using SQLServerMembership. I'm able to connect to that database through AGS, however, when I go to add roles/users, it adds it under another applicationID and applicationName. Seems like they can configure a real simple solution to this instead of making us run around all over the web looking for solutions.

I will keep you posted if I make any process.

Thanks again.

Ruchira

0 Kudos
RyanKoehnen
New Contributor III
0 Kudos
GerardoGarcia
New Contributor III

Nice discussion guys. And yes, these things are annoying!

Two things:

First related to Ryan's reply, you could probably follow the help section for ASP.NET which if you follow his link will be right below the Java link in the table of contents. The link is ArcGIS Help (10.2, 10.2.1, and 10.2.2) .

Second, if you'd like to continue with what you have (existing sqlmembership store) you could change the applicationName you're currently using in the database (which by default I believe is "/") to "esriags", but, as long as this doesn't break or interfere with anything else you or your team has built. Then you could change the "applicationName" attribute in your web.config file which would then allow you to map all of your users/roles.

Hope this helps. Thanks for the feedback folks.

0 Kudos
nicogis
MVP Frequent Contributor

if you are interested I have developed a custom identity provider in .net : NicoGis - Sviluppare in ambiente ArcGIS...: Custom Identity store ASP.NET

download solution

0 Kudos