AnsweredAssumed Answered

How to get license level from arcgis portal login

Question asked by yms_sk on Nov 26, 2018
Latest reply on Nov 28, 2018 by yms_sk

Hi,

I am using LicenseInfo by authenticating user to arcgis poral. The code is like this (copied from some sample):

 

                // Create a challenge request for portal credentials (OAuth credential request for arcgis.com)
                CredentialRequestInfo challengeRequest = new CredentialRequestInfo();

 

                // Use the OAuth implicit grant flow
                challengeRequest.GenerateTokenOptions = new GenerateTokenOptions
                {
                    //TokenAuthenticationType = TokenAuthenticationType.OAuthImplicit
                    TokenAuthenticationType = TokenAuthenticationType.ArcGISToken
                };

 

                // Indicate the url (portal) to authenticate with (ArcGIS Online)
                challengeRequest.ServiceUri = new Uri(this.PortalAccount.PortalUrl);

 

                //// Call GetCredentialAsync on the AuthenticationManager to invoke the challenge handler
                //await AuthenticationManager.Current.GetCredentialAsync(challengeRequest, false);

 

                // Call GetCredentialAsync on the AuthenticationManager to invoke the challenge handler
                Credential cred = await AuthenticationManager.Current.GetCredentialAsync(challengeRequest, false);

 


                // Call GetCredentialAsync on the AuthenticationManager to invoke the challenge handler
                // Credential cred = await AuthenticationManager.Current.GetCredentialAsync(loginInfo, false);

 

                // Connect to the portal(ArcGIS Online) using the credential
                ArcGISPortal arcgisPortal = await ArcGISPortal.CreateAsync(challengeRequest.ServiceUri, cred);

 

                Esri.ArcGISRuntime.LicenseInfo licenseInfo = arcgisPortal.PortalInfo.LicenseInfo;

 

 

So I have PortalUser object (arcgisPortal.User ) and LicenseInfo object and I would like to know what kind of license user has (lite or basic) or at least if that user is Level1 or Level2 portal user. I just can't find it there. How can I find it ?

 

Thank you.

Outcomes