Initialize OAuth client from registry.
764791
def client(self, client_name, **params):
        """"""
        if client_name not in self.cfg.clients:
            raise OAuthException('Unconfigured client: %s' % client_name)

        if client_name not in ClientRegistry.clients:
            raise OAuthException('Unsupported services: %s' % client_name)

        params = dict(self.cfg.clients[client_name], **params)
        return ClientRegistry.clients[client_name](**params)
824480
function initClient() {

    var scope = "https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/genomics https://www.googleapis.com/auth/devstorage.read_only https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/drive.readonly";

    let browser;

    igv.google.loadGoogleProperties("https://s3.amazonaws.com/igv.org.app/web_client_google")

        .then(function (properties) {

            return gapi.client.init({
                'clientId': properties["client_id"],
                'scope': scope
            });
        })
        
        .then(function (ignore) {
            gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus);
        })

        .then(function () {

            var div, options;

            div = $("#myDiv")[0];
            options = {
                genome: "hg19",
                apiKey: igv.google.properties["api_key"],
                queryParametersSupported: true
            };

            igv.createBrowser(div, options)
                .then(function (b) {
                    igv.browser = b;
                })

            
        })

    //
    // function handleSignInClick(event) {
    //     // Nothing to do
    // }

    function updateSigninStatus(isSignedIn) {

        if (isSignedIn) {
            //$("#signInButton").hide();

            var user = gapi.auth2.getAuthInstance().currentUser.get();
            var profile = user.getBasicProfile();
            var username = profile.getName();
            $("#switchUserLink").html("Logged in as: " + username);

        }

    }

}
57723
public void initialize(IClient client) {
        if (log.isDebugEnabled()) {
            log.debug("initialize - client: {}", client);
        }
        if (this.client != null && this.client instanceof Client && !this.client.equals(client)) {
            // unregister old client
            if (log.isTraceEnabled()) {
                log.trace("Unregistering previous client: {}", this.client);
            }
            ((Client) this.client).unregister(this, false);
        }
        this.client = client;
        if (this.client instanceof Client && !((Client) this.client).isRegistered(this)) {
            // register new client
            if (log.isTraceEnabled()) {
                log.trace("Registering client: {}", this.client);
            }
            ((Client) this.client).register(this);
        }
    }
192591
public function initializeObject()
    {
        $client = new \Raven_Client($this->dsn);
        $errorHandler = new \Raven_ErrorHandler($client, true);
        $errorHandler->registerShutdownFunction();
        $this->client = $client;

        $this->setTags();
        $this->setEnvironment();
        $this->setRelease();
        $this->setAppPath();
        $this->setPrefixes();

        $this->emitSentryClientCreated($client);
    }
681992
def init_app(self, app):
        """"""
        self.init_config(app)
        self.cache = Cache(app)
        self.is_authenticated_callback = _callback_factory(
            app.config['CACHE_IS_AUTHENTICATED_CALLBACK'])
        app.extensions['invenio-cache'] = self
1094916
@Deprecated
  public RegistryAuth fromConfig(final Path configPath, final String serverAddress)
      throws IOException {
    return authForRegistry(configPath, serverAddress);
  }
505795
def init_app(self, app):
        
        secrets = self.load_secrets(app)
        self.client_secrets = list(secrets.values())[0]
        secrets_cache = DummySecretsCache(secrets)

        # Set some default configuration options
        app.config.setdefault('OIDC_SCOPES', ['openid', 'email'])
        app.config.setdefault('OIDC_GOOGLE_APPS_DOMAIN', None)
        app.config.setdefault('OIDC_ID_TOKEN_COOKIE_NAME', 'oidc_id_token')
        app.config.setdefault('OIDC_ID_TOKEN_COOKIE_PATH', '/')
        app.config.setdefault('OIDC_ID_TOKEN_COOKIE_TTL', 7 * 86400)  # 7 days
        # should ONLY be turned off for local debugging
        app.config.setdefault('OIDC_COOKIE_SECURE', True)
        app.config.setdefault('OIDC_VALID_ISSUERS',
                              (self.client_secrets.get('issuer') or
                               GOOGLE_ISSUERS))
        app.config.setdefault('OIDC_CLOCK_SKEW', 60)  # 1 minute
        app.config.setdefault('OIDC_REQUIRE_VERIFIED_EMAIL', False)
        app.config.setdefault('OIDC_OPENID_REALM', None)
        app.config.setdefault('OIDC_USER_INFO_ENABLED', True)
        app.config.setdefault('OIDC_CALLBACK_ROUTE', '/oidc_callback')
        app.config.setdefault('OVERWRITE_REDIRECT_URI', False)
        app.config.setdefault("OIDC_EXTRA_REQUEST_AUTH_PARAMS", {})
        # Configuration for resource servers
        app.config.setdefault('OIDC_RESOURCE_SERVER_ONLY', False)
        app.config.setdefault('OIDC_RESOURCE_CHECK_AUD', False)

        # We use client_secret_post, because that's what the Google
        # oauth2client library defaults to
        app.config.setdefault('OIDC_INTROSPECTION_AUTH_METHOD', 'client_secret_post')
        app.config.setdefault('OIDC_TOKEN_TYPE_HINT', 'access_token')

        if not 'openid' in app.config['OIDC_SCOPES']:
            raise ValueError('The value "openid" must be in the OIDC_SCOPES')

        # register callback route and cookie-setting decorator
        if not app.config['OIDC_RESOURCE_SERVER_ONLY']:
            app.route(app.config['OIDC_CALLBACK_ROUTE'])(self._oidc_callback)
            app.before_request(self._before_request)
            app.after_request(self._after_request)

        # Initialize oauth2client
        self.flow = flow_from_clientsecrets(
            app.config['OIDC_CLIENT_SECRETS'],
            scope=app.config['OIDC_SCOPES'],
            cache=secrets_cache)
        assert isinstance(self.flow, OAuth2WebServerFlow)

        # create signers using the Flask secret key
        self.extra_data_serializer = JSONWebSignatureSerializer(
            app.config['SECRET_KEY'], salt='flask-oidc-extra-data')
        self.cookie_serializer = JSONWebSignatureSerializer(
            app.config['SECRET_KEY'], salt='flask-oidc-cookie')

        try:
            self.credentials_store = app.config['OIDC_CREDENTIALS_STORE']
        except KeyError:
            pass
71054
function initClient() {

    var scope =
        "https://www.googleapis.com/auth/cloud-platform " +
        "https://www.googleapis.com/auth/genomics " +
        "https://www.googleapis.com/auth/devstorage.read_only " +
        "https://www.googleapis.com/auth/userinfo.profile " +
        "https://www.googleapis.com/auth/drive.readonly";

    igv.google.loadGoogleProperties("https://s3.amazonaws.com/igv.org.app/web_client_google")

        .then(function (properties) {

            var foo = {
                'clientId': properties["client_id"],
                'scope': scope

            };

            return gapi.client.init(foo);
        })
        .then(function () {

            gapi.signin2.render('signInButton', {
                'scope': scope,
                'width': 120,
                'height': 30,
                'longtitle': false,
                'theme': 'dark',
                'onsuccess': handleSignInClick,
                'onfailure': function (error) {
                    console.log(error)
                }
            });

            var div, options, browser;

            div = $("#myDiv")[0];
            options = {

                genome: "hg19",
                locus: 'myc',
                apiKey: igv.google.properties["api_key"],
            };

            browser = igv.createBrowser(div, options);

            gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus);
        })


    function handleSignInClick(event) {
        // Nothing to do
    }

    function updateSigninStatus(isSignedIn) {

        const user = gapi.auth2.getAuthInstance().currentUser.get();
        const token = user.getAuthResponse().access_token;
        igv.oauth.google.setToken(token);
       // igv.oauth.setToken(token, "*googleapis*");
    }

}
369436
def init_app(self, app):
        """"""
        self.init_config(app)
        app.extensions['invenio-github'] = self

        @app.before_first_request
        def connect_signals():
            """Connect OAuthClient signals."""
            from invenio_oauthclient.models import RemoteAccount
            from invenio_oauthclient.signals import account_setup_committed

            from .api import GitHubAPI
            from .handlers import account_post_init

            account_setup_committed.connect(
                account_post_init,
                sender=GitHubAPI.remote._get_current_object()
            )

            @event.listens_for(RemoteAccount, 'before_delete')
            def receive_before_delete(mapper, connection, target):
                """Listen for the 'before_delete' event."""
870047
def authorized_default_handler(resp, remote, *args, **kwargs):
    
    response_token_setter(remote, resp)
    db.session.commit()
    return redirect(url_for('invenio_oauthclient_settings.index'))
405757
function initClient() {
	gapi.client.init({
		apiKey: config.api.google.web.key,
		clientId: config.api.google.web.client_id,
		discoveryDocs: DISCOVERY_DOCS,
		scope: SCOPES
	}).then(function () {
		// Listen for sign-in state changes.
		gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus);

		// Handle the initial sign-in state.
		updateSigninStatus(gapi.auth2.getAuthInstance().isSignedIn.get());
		authorizeButton.onclick = handleAuthClick;
		signoutButton.onclick = handleSignoutClick;
	}, function(error) {
		appendPre(JSON.stringify(error, null, 2));
	});
}
1186739
def initialize_api(args):
  
  global api
  api = ApiResource(server_host=args.hostname, server_port=args.port,
                    username=args.username, password=args.password,
                    version=args.api_version, use_tls=args.use_tls)
687908
def _initialize(self):
        """"""

        payload = {
            'apikey': self.session.cookies.get('apikey'),
            'source': self.session.cookies.get('source')
            }

        if self.fm_user.logged_in:
            payload['logintoken'] = self.session.cookies.get('logintoken')

        payload.update(self.transfer_info)

        method, url = get_URL('init')

        res = getattr(self.session, method)(url, params=payload)

        if res.status_code == 200:
            for key in ['transferid', 'transferkey', 'transferurl']:
                self.transfer_info[key] = res.json().get(key)

        else:
            hellraiser(res)
63347
private static function initialize()
    {
        if (self::$initialized) return;

        self::$client = \OpenId::getClient();
        self::$version = config('openid.api-version');
        self::$initialized = TRUE;
    }
243638
async def init(app, loop):
    """"""
    app.session = aiohttp.ClientSession(loop=loop)  # to make web requests
    app.webhook = Webhook.Async(webhook_url, session=app.session)

    em = Embed(color=0x2ecc71)
    em.set_author('[INFO] Starting Worker')
    em.description = 'Host: {}'.format(socket.gethostname())

    await app.webhook.send(embed=em)
1157507
function onRegistered(client, url) {
  let server
  return new Promise(resolve => {
    server = http.createServer((request, response) => {
      if (request.url.indexOf('/do_access') === 0) {
        log('debug', request.url, 'url received')
        resolve(request.url)
        response.end(
          'Authorization registered, you can close this page and go back to the cli'
        )
      }
    })
    server.listen(3333, () => {
      require('opn')(url, { wait: false })
      console.log(
        'A new tab just opened in your browser to require the right authorizations for this connector in your cozy. Waiting for it...'
      )
      console.log(
        'If your browser does not open (maybe your are in a headless virtual machine...), then paste this url in your browser'
      )
      console.log(url)
    })
  }).then(
    url => {
      server.close()
      return url
    },
    err => {
      server.close()
      log('error', err, 'registration error')
      throw err
    }
  )
}
487790
public function initializeObject()
    {
        $settings = $this->configurationManager->getConfiguration(\Neos\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow');
        if (isset($settings['security']['authentication']['providers']['Neos.Setup:Login']['providerOptions']['keyName'])) {
            $this->keyName = $settings['security']['authentication']['providers']['Neos.Setup:Login']['providerOptions']['keyName'];
        }
    }