Select to view content in your preferred language

oAuth and CurrentUser

2840
2
Jump to solution
08-03-2015 10:07 AM
JordanParfitt
Regular Contributor

I have oAuth working - however the current user always comes back as null after I type my username and password:

                IdentityManager.Current.OAuthAuthorizeHandler = new Esri.ArcGISRuntime.Toolkit.Security.OAuthAuthorizeHandler();

                var item = await Esri.ArcGISRuntime.Portal.ArcGISPortalItem.CreateAsync(portal, "367f0a8a210d49218f7cb7bf5da994c8");

                var portal = await Esri.ArcGISRuntime.Portal.ArcGISPortal.CreateAsync();

                var user = portal.CurrentUser; //comes back null

How do I get the current user without re-authenticating?

0 Kudos
1 Solution

Accepted Solutions
AnttiKajanus1
Deactivated User

Hi,

Try to pass the given token to the ArcGISPortal when you are creating it from IdentityManager.

Something like this :

var portal = await ArcGISPortal.CreateAsync(new Uri("http://www.arcgis.com/sharing/rest"), CancellationToken.None, token);

View solution in original post

2 Replies
AnttiKajanus1
Deactivated User

Hi,

Try to pass the given token to the ArcGISPortal when you are creating it from IdentityManager.

Something like this :

var portal = await ArcGISPortal.CreateAsync(new Uri("http://www.arcgis.com/sharing/rest"), CancellationToken.None, token);

JordanParfitt
Regular Contributor

Thanks!

0 Kudos