Select to view content in your preferred language

Problem with SignIn

2009
3
12-03-2013 10:57 PM
AlejandroGonzález_Santiuste
Emerging Contributor
Hey, I have a problem with the security widget. When I launch my application with this code

  private void button1_Click(object sender, RoutedEventArgs e)
        {
            IdentityManager.Current.ChallengeMethod = SignInDialog.DoSignIn;
            featureLayer = new FeatureLayer()
            {
                ID = "distritos ",
                DisplayName = "distritos  Layer",
                Url = "http://kartgis:6080/arcgis/rest/services/biodiversidad_galicia/MapServer/0",
                Mode = FeatureLayer.QueryMode.OnDemand
               
            };

           // featureLayer.InitializationFailed += FeatureLayer_InitializationFailed;
            featureLayer.Initialized += featureLayer_Initialized;
            
            MyMap.Layers.Add(featureLayer);

        }

        void featureLayer_Initialized(object sender, EventArgs e)
        {
            if (featureLayer.EditUserName != null)
            {
                if (featureLayer.EditUserName != "")
                {
                    MyMap.Extent = (sender as Layer).FullExtent;
                    vic.Visibility = System.Windows.Visibility.Visible;
                }
            }
          
           
        }

In xaml go this, and the resource for the sign in

<esri:SignInDialog x:Name="MySignInDialog" Style="{StaticResource SignInDialogTemplate}" Visibility="Collapsed"
                           Title="LOGIN TO ACCESS" UserName="user1" Password="pass.word1" Width="300" Height="260" />

Don't show me anything. 4 months ago, it show me the window to login... ¿How can I solve it?

Thx for all!
0 Kudos
3 Replies
DominiqueBroux
Esri Frequent Contributor
Don't show me anything. 4 months ago, it show me the window to login... ¿How can I solve it?

Thx for all!

At first glance no idea.
I suggest you use fiddler to look at requests sent to the secured server. The response might give a hint.

Sidenote: As you are using the static challenge method SignInDialog.DoSignIn, the signin control is intantiated internally for being displayed in a popup window. So your SignInDialog called 'MySignInDialog' won't be used.
To customize and use your own SignIndialog, you need to redefine a challenge method that activates your SignInDialog.
0 Kudos
AlejandroGonzález_Santiuste
Emerging Contributor
Thx Dominique, but the "problem"  was that the MapServer service was public... then, obviously, the sign in window didn't show, because not permission was required.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Thx Dominique, but the "problem"  was that the MapServer service was public... then, obviously, the sign in window didn't show, because not permission was required.

That explains the behavior:)
0 Kudos