moved from oidcconfigimpl so social can use it.
326255
public String getRedirectUrlFromServerToClient(String clientId, String contextPath, String redirectToRPHostAndPort) {
        String redirectURL = null;
        if (redirectToRPHostAndPort != null && redirectToRPHostAndPort.length() > 0) {
            try {
                final String fHostPort = redirectToRPHostAndPort;
                @SuppressWarnings({ "unchecked", "rawtypes" })
                URL url = (URL) java.security.AccessController.doPrivileged(new java.security.PrivilegedExceptionAction() {
                    @Override
                    public Object run() throws Exception {
                        return new URL(fHostPort);
                    }
                });
                int port = url.getPort();
                String path = url.getPath();
                if (path == null)
                    path = "";
                if (path.endsWith("/")) {
                    path = path.substring(0, path.length() - 1);
                }
                String entryPoint = path + contextPath + "/redirect/" + clientId;
                redirectURL = url.getProtocol() + "://" + url.getHost() + (port > 0 ? ":" + port : "");

                redirectURL = redirectURL + (entryPoint.startsWith("/") ? "" : "/") + entryPoint;
            } catch (Exception e) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "the value of redirectToRPHostAndPort might not valid. Please verify that the format is <protocol>://<host>:<port> " + redirectToRPHostAndPort
                            + "\n" + e.getMessage());
                }
            }
        }
        return redirectURL;
    }
189838
def init_app(self, app, datastore=None):
        

        datastore = datastore or self.datastore

        for key, value in default_config.items():
            app.config.setdefault(key, value)

        providers = dict()

        for key, config in app.config.items():
            if not key.startswith('SOCIAL_') or config is None or key in default_config:
                continue

            suffix = key.lower().replace('social_', '')
            default_module_name = 'flask_social.providers.%s' % suffix
            module_name = config.get('module', default_module_name)
            module = import_module(module_name)
            config = update_recursive(module.config, config)

            providers[config['id']] = OAuthRemoteApp(**config)
            providers[config['id']].tokengetter(_get_token)

        state = _get_state(app, datastore, providers)

        app.register_blueprint(create_blueprint(state, __name__))
        app.extensions['social'] = state

        return state
669518
function removeAssociation($server_url, $handle)
    {
        if (!$this->active) {
            trigger_error("FileStore no longer active", E_USER_ERROR);
            return null;
        }

        $assoc = $this->getAssociation($server_url, $handle);
        if ($assoc === null) {
            return false;
        } else {
            $filename = $this->getAssociationFilename($server_url, $handle);
            return Auth_OpenID_FileStore::_removeIfPresent($filename);
        }
    }
319110
public function up()
    {
        //delete open social table
        dbexec('DROP TABLE #__opensocial_profiles');

        //delete legacy com_cache and com_opensocial
        dbexec('DELETE FROM `#__components` WHERE `option` = \'com_cache\' OR `option` = \'com_opensocial\' ');
        dbexec('DELETE FROM `#__migrator_versions` WHERE component = "opensocial"');

        //some clean up
        dbexec('DELETE FROM `#__components` WHERE name = "" ');

        //fix broken menu link
        dbexec('UPDATE `#__components` SET `admin_menu_link` = \'option=com_mailer\' WHERE `option` = \'com_mailer\' ');

        //Delete legacy plugins
        dbexec('DELETE FROM `#__plugins` WHERE `element` IN ( \'ptag\', \'syntax\', \'opensocial\', \'mtupgrade\', \'usertype\' ) ');

        //remove anahita from nodes and edges table names
        if (!dbexists('SHOW TABLES LIKE "#__nodes"')) {
            dbexec('RENAME TABLE #__anahita_nodes TO #__nodes');
        }

        //add pinned field to the nodes table
        if(!dbexists('SHOW COLUMNS FROM `#__nodes` LIKE "pinned"')) {
            dbexec('ALTER TABLE `#__nodes` ADD `pinned` TINYINT(1) NOT NULL DEFAULT \'0\' AFTER `enabled`');
        }

        //add github gist plugin
        dbexec("INSERT INTO `#__plugins` (`name`, `element`, `folder`, `access`, `ordering`, `published`, `iscore`, `client_id`, `checked_out`, `checked_out_time`, `params`) VALUES ('Content Filter - Medium', 'medium', 'contentfilter', 0, 1, 1, 0, 0, 0, '0000-00-00 00:00:00', '')");

        //remove the photo plugin
        dbexec("DELETE FROM `#__plugins` WHERE `element` = 'photo' ");

        //remove the migrator_migrations table if exists
        dbexec('DROP TABLE `#__migrator_migrations`');

        //some of the plugins are core plugins
        dbexec("UPDATE `#__plugins` SET iscore = 1 WHERE element IN ('joomla', 'gist', 'medium', 'link', 'video', 's3')");
    }
940668
private boolean unregisterHelper(Supplier<Optional<AddOnModel>> suppAdd, Supplier<Optional<AddOnInformation>> suppAddInf) {
        boolean success1 = false;
        Optional<AddOnModel> addOnModel = suppAdd.get();
        if (addOnModel.isPresent()) {
            success1 = addOns.remove(addOnModel.get());
        }

        boolean success2 = false;
        Optional<AddOnInformation> addOnInformation = suppAddInf.get();
        if (addOnInformation.isPresent()) {
            success2 = addOnInformations.remove(addOnInformation.get());
        }

        return success1 && success2;
    }
1365726
function switchAndClear(pkg) {
    switchState(false, pkg);

    //unload proxy routes
    proxy.deleteBy(app.config.get('public-port'), {user: pkg.user, appid: pkg.name});
  }
303201
private static void addInternal(String name, ObjectIdentifier oid,
            Class clazz) {
        OIDInfo info = new OIDInfo(name, oid, clazz);
        oidMap.put(oid, info);
        nameMap.put(name, info);
    }
1244032
void init() throws SocialLoginException {
        if (sslSupport != null) {
            Properties sslProps = null;
            this.jsseHelper = sslSupport.getJSSEHelper();
            if (this.jsseHelper != null) {
                try {
                    if (sslRef != null) {
                        sslProps = this.jsseHelper.getProperties(sslRef); // SSLConfig
                    } else {
                        Map<String, Object> connectionInfo = new HashMap<String, Object>();
                        connectionInfo.put(Constants.CONNECTION_INFO_DIRECTION, Constants.DIRECTION_INBOUND);
                        sslProps = this.jsseHelper.getProperties(null, connectionInfo, null, true); // default
                        // SSL
                    }
                } catch (SSLException e) {
                    throw new SocialLoginException("ERROR_LOADING_SSL_PROPS", e, new Object[] { e.getLocalizedMessage() });
                }
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "sslConfig (" + sslRef + ") get: " + sslProps);
                }
                if (sslProps != null) {
                    this.sslKeyStoreName = sslProps.getProperty(com.ibm.websphere.ssl.Constants.SSLPROP_KEY_STORE_NAME);
                    this.sslTrustStoreName = sslProps.getProperty(com.ibm.websphere.ssl.Constants.SSLPROP_TRUST_STORE_NAME);
                }
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "sslTrustStoreName: " + this.sslTrustStoreName);
                }
            }
        }
    }
981771
function move(root, nextTag, isVirtual) {
      if (isVirtual)
        { moveVirtual.apply(this, [root, nextTag]); }
      else
        { safeInsert(root, this.root, nextTag.root); }
    }
640378
def cleanup_headers(self):
        """"""
        headers = {'Content-Type': 'application/json'}
        headers['Authorization'] = self.__token
        self.__headers = headers
        self.__params = {}
6320
function() {
    this.header = undefined;
    this.credentials = undefined;
    this.meta = undefined;
    this.xml = undefined;
    this.binaries = new KdbxBinaries();
    this.groups = [];
    this.deletedObjects = [];
    Object.preventExtensions(this);
}
240322
public function uninstall_cleanup() {
        global $CFG;

        if (!empty($CFG->auth)) {
            $auths = explode(',', $CFG->auth);
            $auths = array_unique($auths);
        } else {
            $auths = array();
        }
        if (($key = array_search($this->name, $auths)) !== false) {
            unset($auths[$key]);
            set_config('auth', implode(',', $auths));
        }

        if (!empty($CFG->registerauth) and $CFG->registerauth === $this->name) {
            unset_config('registerauth');
        }

        parent::uninstall_cleanup();
    }
434157
public function initSdk() {
    $class_name = '\Google_Client';

    if (!class_exists($class_name)) {
      throw new SocialApiException(sprintf('The PHP SDK for Google Services could not be found. Class: %s.', $class_name));
    }

    if (!$this->validateConfig($this->settings)) {
      return FALSE;
    }

    $client = new $class_name();
    $client->setClientId($this->settings->getClientId());
    $client->setClientSecret($this->settings->getClientSecret());

    return $client;
  }
284371
function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
			if (ua.w3 && objectIdStr && swfVersionStr) {
				var regObj = {};
				regObj.id = objectIdStr;
				regObj.swfVersion = swfVersionStr;
				regObj.expressInstall = xiSwfUrlStr;
				regObj.callbackFn = callbackFn;
				regObjArr[regObjArr.length] = regObj;
				setVisibility(objectIdStr, false);
			}
			else if (callbackFn) {
				callbackFn({success:false, id:objectIdStr});
			}
		}
955230
def replace_uid(old_uwnetid, new_uwnetid, no_custom_fields=True):
    
    url = author_uid_url(old_uwnetid)
    if not no_custom_fields:
        url += ("?%s" % CUSTOM_FIELD)
    resp = patch_resource(url, '{"user":{"uid":"%s@uw.edu"}}' % new_uwnetid)
    return _process_json_resp_data(resp,
                                   no_custom_fields=no_custom_fields)
41293
private void moveDownloadedPlugins() {
    if (fs.getDownloadedPluginsDir().exists()) {
      for (File sourceFile : listJarFiles(fs.getDownloadedPluginsDir())) {
        overrideAndRegisterPlugin(sourceFile);
      }
    }
  }
459960
def pre_social_login(self, request, sociallogin):
        """"""

        user = sociallogin.user
        # If the user hasn't been saved yet, it will be updated
        # later on in the sign-up flow.
        if not user.pk:
            return

        data = sociallogin.account.extra_data
        oidc = sociallogin.account.provider == 'helsinki_oidc'
        update_user(user, data, oidc)