ArcGISRuntimeXamarin.Forms.Droid.OAuthPageAndroid.UpdateAuthenticationManager C# (CSharp) Метод

UpdateAuthenticationManager() приватный Метод

private UpdateAuthenticationManager ( ) : void
Результат void
        private void UpdateAuthenticationManager()
        {
            // OAuth client info
            OAuthClientInfo oauthInfo = new OAuthClientInfo
            {
                ClientId = OAuthPage.AppClientId,
                RedirectUri = new Uri(OAuthPage.OAuthRedirectUrl)
            };

            // If a client secret has been included, add it
            if (!string.IsNullOrEmpty(OAuthPage.ClientSecret))
            {
                oauthInfo.ClientSecret = OAuthPage.ClientSecret;
            }

            // Register the server information (and OAuth info) with the AuthenticationManager
            ServerInfo portalServerInfo = new ServerInfo
            {
                ServerUri = new Uri(OAuthPage.PortalUrl),
                OAuthClientInfo = oauthInfo,
            };

            // Specify OAuthAuthorizationCode if a valid client secret has been specified (need a refresh token, e.g.)            
            if (!string.IsNullOrEmpty(OAuthPage.ClientSecret))
            {
                portalServerInfo.TokenAuthenticationType = TokenAuthenticationType.OAuthAuthorizationCode;
            }
            else
            {
                // Otherwise, use OAuthImplicit
                portalServerInfo.TokenAuthenticationType = TokenAuthenticationType.OAuthImplicit;
            }

            // Get a reference to the (singleton) AuthenticationManager for the app
            AuthenticationManager thisAuthenticationManager = AuthenticationManager.Current;

            // Register the server information
            thisAuthenticationManager.RegisterServer(portalServerInfo);

            // Assign the method that AuthenticationManager will call to challenge for secured resources
            thisAuthenticationManager.ChallengeHandler = new ChallengeHandler(CreateCredentialAsync);

            // Set the OAuth authorization handler to this class (Implements IOAuthAuthorize interface)
            thisAuthenticationManager.OAuthAuthorizeHandler = this;
        }