public TokenLifetime SetTokenLifetime(
            long?maxHoKTokenLifetime,
            long?maxBearerTokenLifetime)
        {
            var authorizedInvocationContext =
                CreateAuthorizedInvocationContext();

            if (maxHoKTokenLifetime != null)
            {
                authorizedInvocationContext.
                InvokeOperation(() =>
                                _ssoAdminBindingClient.SetMaximumHoKTokenLifetimeAsync(
                                    new ManagedObjectReference {
                    type  = "SsoAdminConfigurationManagementService",
                    Value = "configurationManagementService"
                },
                                    maxHoKTokenLifetime.Value)).Wait();
            }

            if (maxBearerTokenLifetime != null)
            {
                authorizedInvocationContext.
                InvokeOperation(() =>
                                _ssoAdminBindingClient.SetMaximumBearerTokenLifetimeAsync(
                                    new ManagedObjectReference {
                    type  = "SsoAdminConfigurationManagementService",
                    Value = "configurationManagementService"
                },
                                    maxBearerTokenLifetime.Value)).Wait();
            }


            return(GetTokenLifetime());
        }