Select to view content in your preferred language

Flex Mobile and OAuth Question

513
1
09-30-2013 01:35 PM
MattSheehan
Deactivated User
We are adding OAuth to a Flex Mobile app. We've looked at the online samples, but see none for Flex Mobile. We have the following:

   public function login():void
   { 
    //Oath authentication - App id
    var oAuthInfo:OAuthInfo = new OAuthInfo("........");
    IdentityManager.instance.registerOAuthInfos([ oAuthInfo ]);
    
    IdentityManager.instance.enabled = true;
    
    defaultQueryParameters = new PortalQueryParameters();
    
    portalService = new Portal();
    portalService.addEventListener(FaultEvent.FAULT, esriService_faultHandler);
    portalService.addEventListener(PortalEvent.LOAD, portalService_loadHandler);
    portalService.addEventListener(PortalEvent.QUERY_ITEMS_COMPLETE, portalService_queryItemsCompleteHandler);
    
    portalService.url = serverURL;
    
    portalService.signIn();
    
   }


This works just fine, but we suspect we are missing some pieces for full OAuth. Could somebody let us know if we are correct, and what else we need add?

Thanks

--Matt
Tags (2)
0 Kudos
1 Reply
DasaPaddock
Esri Regular Contributor
To make it work with the defaults, you just need to make sure that your app registration allows the "urn:ietf:wg:oauth:2.0:oob" redirect URI. Additional functionality you may want to add to your app is to allow the user to sign out. See:
https://developers.arcgis.com/en/flex/api-reference/com/esri/ags/components/IdentityManager.html#sig...
0 Kudos