Select to view content in your preferred language

Authentication, user logins and Flex in a .NET framework

3998
18
Jump to solution
10-10-2012 10:15 AM
ionarawilson1
Deactivated User
Does anybody have any article, tutorial or link to instructions on how to integrate FLEX in a .NET environment, specially with respect to  authentication? How do we create user logins (which the user could create his own login and password) with Flex in a .NET environment? I looked all over the web and can't find anything on this topic.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AaronNash1
Frequent Contributor
There was some code posted in the old forum that showed people how to handle a simple log in screen, but it was pulled because to many people were having issues implementing the .net webservice and modifying the index.mxml in the flexivewer.

All you would need to do it compile the .net webservice in visual studios and place it in a web directory in IIS. Then edit the index.mxml in the flexviewer (or whatever application you are using) to include the code from the attached file. In line 89 of the attached index.mxml you will need to change the URL to your newly compiled webservice. I take no credit for this code, I downloaded it and was able to implement it in my environment. This will get you started with securing flex applications, but the administrator will need to create the usernames and password.

View solution in original post

0 Kudos
18 Replies
AaronNash1
Frequent Contributor
There was some code posted in the old forum that showed people how to handle a simple log in screen, but it was pulled because to many people were having issues implementing the .net webservice and modifying the index.mxml in the flexivewer.

All you would need to do it compile the .net webservice in visual studios and place it in a web directory in IIS. Then edit the index.mxml in the flexviewer (or whatever application you are using) to include the code from the attached file. In line 89 of the attached index.mxml you will need to change the URL to your newly compiled webservice. I take no credit for this code, I downloaded it and was able to implement it in my environment. This will get you started with securing flex applications, but the administrator will need to create the usernames and password.
0 Kudos
ionarawilson1
Deactivated User
This is awesome!!! Thank you so much for this! I am starting to learn how to use VS so this is perfect!

I am not using flex viewer  so if I want to allow users to view my application do I just deleted the code to get access to flexviewer ( lines 135 forward) and include the code for my web application ?
Also, the login would just to get to the web application and not to edit any feature layers, right? Is there a way to implement editing of the feature layers so the logged users can edit it?
0 Kudos
grahamcooke
Regular Contributor
What I did was a create a .NET wrapper application and simply host the flex application in one of the aspx pages. There is another thread about flex login here:http://forums.arcgis.com/threads/25899-Login-Screen-for-the-Flexviewer?p=168298#post168298
0 Kudos
AaronNash1
Frequent Contributor
This is awesome!!! Thank you so much for this! I am starting to learn how to use VS so this is perfect!

I am not using flex viewer  so if I want to allow users to view my application do I just deleted the code to get access to flexviewer ( lines 135 forward) and include the code for my web application ?
Also, the login would just to get to the web application and not to edit any feature layers, right? Is there a way to implement editing of the feature layers so the logged users can edit it?


If you want to implement this into your own application copy lines 24 through 137, add line 21 into your application tag (to set the current state to login) and within your code for your map add "includeIn="Viewer" That will set the default state of the application to Log in and then when the user logs in the state will change to viewer which is your map.

The login would just allow users to get into your application, whatever you enable in your application is what they would have access to. If you want to enable editing of a feature layer there are some nice samples available, like this one, if you are using ArcServer 10.1 there is also some new security features like this one
0 Kudos
ionarawilson1
Deactivated User
What I did was a create a .NET wrapper application and simply host the flex application in one of the aspx pages. There is another thread about flex login here:http://forums.arcgis.com/threads/25899-Login-Screen-for-the-Flexviewer?p=168298#post168298


Hi Graham,
I am very interested to see how you did it.
You say in  your previous thread: "If anyone is interested I can make the .NET code available together with the stored procedures for creating the authorisation tables in SQLServer,". Could you make it available to me? Thanks!!!
0 Kudos
ionarawilson1
Deactivated User
Thank you again Aaron. I will try that and see how it goes! Cheers!
0 Kudos
JustinNettleton
Deactivated User
If you want to implement this into your own application copy lines 24 through 137, add line 21 into your application tag (to set the current state to login) and within your code for your map add "includeIn="Viewer" That will set the default state of the application to Log in and then when the user logs in the state will change to viewer which is your map.

The login would just allow users to get into your application, whatever you enable in your application is what they would have access to. If you want to enable editing of a feature layer there are some nice samples available, like this one, if you are using ArcServer 10.1 there is also some new security features like this one


I took this approach and got the log in screen to pop-up but if goes away real quick and the map I am trying to secure pops up. So the login screen loads, but is bypassed very quickly. I tried to change "includeIn="Viewer" but that just error-ed out when I tried to compile.

Am I missing something?

Thanks,
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
JustinNettleton
Deactivated User
Thanks Robert, actually fixed my problem but this thread answers some other questions I had.
0 Kudos