Select to view content in your preferred language

How to get ID and Pass at IdentityManager

2514
5
Jump to solution
01-31-2014 07:57 AM
EvelynHernandez
Frequent Contributor
Hello there.
Im new programming in ARCGIS x Flex app and I have a question.
I put in my code
IdentityManager.instance.enabled = true;

to make a login in to access a map
but now i have to get the ID when a user is logging in to try to make a filter for other thing
I hope u guys can help me or making me a reference.
Thx.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KomanDiabate
Deactivated User
Hi All,
I believe that featureLayer has and userId property, so you can get the userId using this:
featureLayerName.userId. See reference below.

https://developers.arcgis.com/flex/api-reference/com/esri/ags/layers/FeatureLayer.html

Hope this helps.

View solution in original post

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus
endlessdsire,

   I have never just tried to get the userid, Most of the time I just need the token. But the principle is the same, to get a credential object.

if(IdentityManager.instance.enabled){
                            var cred:Credential = IdentityManager.instance.findCredential(lyrURL);
                            if (cred && cred.token){
                                lyrToken = cred.token;
                            }
                        }
0 Kudos
EvelynHernandez
Frequent Contributor
Thanks i will try it. (: but theres something that i dont understand.
LyrURL and LyrToken,
the url is from the page that the user put the id?
the other one what is it?
Thanks for ur help
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Evelyn,

   The lyrURL is the URL address of what ever map service that was used that is secured and required the login. As far as what is the lyrToken. You need to read the documentation.

https://developers.arcgis.com/flex/api-reference/com/esri/ags/components/supportClasses/Credential.h...
0 Kudos
KomanDiabate
Deactivated User
Hi All,
I believe that featureLayer has and userId property, so you can get the userId using this:
featureLayerName.userId. See reference below.

https://developers.arcgis.com/flex/api-reference/com/esri/ags/layers/FeatureLayer.html

Hope this helps.
0 Kudos
EvelynHernandez
Frequent Contributor
Hi All,
I believe that featureLayer has and userId property, so you can get the userId using this:
featureLayerName.userId. See reference below.

https://developers.arcgis.com/flex/api-reference/com/esri/ags/layers/FeatureLayer.html

Hope this helps.


Thanks i will try it. 🙂
0 Kudos