Register OAuth App.
546194
private function registerOAuthApp()
    {
        $oauth = new OAuthApp();
        $this->app->instance(\Acacha\LaravelSocial\Services\OAuthApp::class, $oauth);
    }
896327
public function register ()
	{
		$this->app->singleton('vatsimoauth', function ( $app )
		{
			// vatsim::config is Laravel 4.x
			$config = $app['config']['vatsim-sso'] ?: $app['config']['vatsim::config'];

			// Make sure we don't crash when we did not publish the config file
			if ( is_null($config) )
			{
				$config = [];
			}

			return new SSO(
				array_get($config, 'base'), // base
				array_get($config, 'key'), // key
				array_get($config, 'secret'), // secret
				array_get($config, 'method'), // method
				array_get($config, 'cert') // certificate
			);
		});
	}
814695
async def register(self, request):
        """"""
        session = await get_session(request)
        user_id = session.get('user_id')
        if user_id:
            return redirect(request, 'timeline')

        error = None
        form = None
        if request.method == 'POST':
            form = await request.post()

            user_id = await db.get_user_id(self.mongo.user, form['username'])
            if not form['username']:
                error = 'You have to enter a username'
            elif not form['email'] or '@' not in form['email']:
                error = 'You have to enter a valid email address'
            elif not form['password']:
                error = 'You have to enter a password'
            elif form['password'] != form['password2']:
                error = 'The two passwords do not match'
            elif user_id is not None:
                error = 'The username is already taken'
            else:
                await self.mongo.user.insert(
                    {'username': form['username'],
                     'email': form['email'],
                     'pw_hash': generate_password_hash(form['password'])})
                return redirect(request, 'login')
        return {"error": error, "form": form}
806495
public function register()
    {
        $this->app['events']->listen('auth.login', 'Orchestra\OneAuth\Handlers\UserLoggedIn');
        $this->app['events']->listen('orchestra.oneauth.user: saved', 'Orchestra\OneAuth\Handlers\UserConnected');
        $this->app['events']->listen('auth.logout', 'Orchestra\OneAuth\Handlers\UserLoggedOut');
    }
821459
public function register()
	{
		$this->mergeConfigFrom(
			__DIR__ . '/config/config.php', 'react'
		);

		$this->app['react'] = $this->app->share(function($app)
		{
			return $app->make('AllanTatter\React\React');
		});
	}
44939
public function register()
	{
		$this->app->register('LucaDegasperi\OAuth2Server\Storage\FluentStorageServiceProvider');
		$this->app->register('LucaDegasperi\OAuth2Server\OAuth2ServerServiceProvider');
		
		$config_path = __DIR__.'/../../config/api.php';
		$this->mergeConfigFrom($config_path, 'api');
		$this->publishes([
			$config_path => config_path('api.php')
		], 'config');
		
		$m_from = __DIR__ . '/../../migrations/';
		$m_to = $this->app['path.database'] . '/migrations/';
		$this->publishes([
			$m_from.'2015_05_30_000000_oauth_server.php' => $m_to.'2015_05_30_000000_oauth_server.php',
		], 'migrations');
	}
145158
public function register()
	{
        $this->app->singleton('basement', function()
        {
            // retrieve settings from app/config/database.php
            extract(Config::get('database.couchbase'));

            $defaults = array(
                'name' => 'default',
                'host' => isset($host) ? $host : '127.0.0.1',
                'bucket' => isset($bucket) ? $bucket : 'default',
                'password' => isset($password) ? $password : null,
                'user' => null,
                'persist' => isset($persist_conn) ? $persist_conn : false,
                'connect' => true,
                'transcoder' => 'json',
				'environment' => preg_match('/dev|local/i', App::environment()) ? 'development' : App::environment()
            );

            return new Client($defaults);
        });

        // Shortcut so developers don't need to add an Alias in app/config/app.php
        $this->app->booting(function()
        {
            $loader = AliasLoader::getInstance();
            $loader->alias('Cb', 'Shift31\LaravelBasement\Facades\Cb');
        });
	}
176882
protected function registerAuth()
    {
        $this->app->singleton('api.auth', function ($app) {
            return new Auth($app['Dingo\Api\Routing\Router'], $app, $this->config('auth'));
        });
    }
332573
public function registerApplication() 
    {
        $options = $this->config->getAppConfiguration();
        $credentials = $this->getResponse(
            '/api/'.ConfigurationVO::API_VERSION.'/apps',
            $options
        );
        if (isset($credentials["client_id"])
            && isset($credentials["client_secret"])
        ) {
            $this->config->setClientId($credentials['client_id']);
            $this->config->setClientSecret($credentials['client_secret']);
        }else {
            echo 'ERROR: no credentials in API response';
        }
    }
165843
public function register()
    {
        $this->bindGuzzle();

        $this->bindAuth();

        $this->bindHttpClient();

        $this->bindApiClient();

        $this->bindTaxonomyMapper();
    }
219632
public function register()
    {
        $this->di->setShared(
            'authServer',

            function () {
                /* @var \Pails\Container $this */

                // Init repositories
                $clientRepository = new ClientRepository();
                $scopeRepository = new ScopeRepository();
                $accessTokenRepository = new AccessTokenRepository();
                $authCodeRepository = new AuthCodeRepository();
                $userRepository = new UserRepository();
                $refreshTokenRepository = new RefreshTokenRepository();

                // Keys
                $privateKey = $this['config']->get('oauth2.private_key');
                $publicKey = $this['config']->get('oauth2.public_key');

                // Setup authorization server
                $server = new AuthorizationServer(
                    $clientRepository,
                    $accessTokenRepository,
                    $scopeRepository,
                    $privateKey,
                    $publicKey);

                if ($this['config']->get('oauth2.client_credential.enabled')) {
                    // clientGrant
                    $server->enableGrantType(
                        new ClientCredentialsGrant(),
                        seconds2interval($this['config']->get('oauth2.client_credential.token_ttl', 3600))
                    );
                }

                if ($this['config']->get('oauth2.password.enabled')) {
                    // passwordGrant
                    $passwordGrant = new PasswordGrant(
                        $userRepository,
                        $refreshTokenRepository
                    );
                    $passwordGrant->setRefreshTokenTTL(seconds2interval($this['config']->get('oauth2.password.refresh_token_ttl', 2592000)));
                    $server->enableGrantType(
                        $passwordGrant,
                        seconds2interval($this['config']->get('oauth2.password.token_ttl', 3600))
                    );
                }

                if ($this['config']->get('oauth2.auth_code.enabled')) {
                    // authCodeGrant
                    $authCodeGrant = new AuthCodeGrant(
                        $authCodeRepository,
                        $refreshTokenRepository,
                        seconds2interval($this['config']->get('oauth2.auth_code.code_ttl', 3600))
                    );
                    $authCodeGrant->setRefreshTokenTTL(seconds2interval($this['config']->get('oauth2.auth_code.refresh_token_ttl', 2592000)));
                    $server->enableGrantType(
                        $authCodeGrant,
                        seconds2interval($this['config']->get('oauth2.auth_code.token_ttl', 3600))
                    );
                }

                if ($this['config']->get('oauth2.refresh_token.enabled')) {
                    // refreshTokenGrant
                    $refreshTokenGrant = new RefreshTokenGrant(
                        $refreshTokenRepository
                    );
                    $server->enableGrantType(
                        $refreshTokenGrant,
                        seconds2interval($this['config']->get('oauth2.refresh_token.token_ttl', 3600))
                    );
                }

                if ($this['config']->get('oauth2.implicit.enabled')) {
                    // implicit grant
                    $server->enableGrantType(
                        new ImplicitGrant(seconds2interval($this['config']->get('oauth2.implicit.token_ttl', 3600))),
                        seconds2interval($this['config']->get('oauth2.implicit.token_ttl', 3600))
                    );
                }

                return $server;
            }
        );

        $this->di->setShared(
            'resourceServer',

            function () {
                /* @var \Pails\Container $this */
                $accessTokenRepository = new AccessTokenRepository();
                $publicKey = $this['config']->get('oauth2.public_key');

                $resourceServer = new ResourceServer($accessTokenRepository, $publicKey);

                return $resourceServer;
            }
        );

        $this->di->setShared(
            'authClient',

            function () {
                /* @var \Pails\Container $this */
                $provider = new GenericProvider([
                    'clientId'                => $this['config']->get('oauth2.client.client_id'),
                    'clientSecret'            => $this['config']->get('oauth2.client.client_secret'),
                    'redirectUri'             => $this['config']->get('oauth2.client.redirect_url'),
                    'urlAuthorize'            => $this['config']->get('oauth2.client.authorize_url'),
                    'urlAccessToken'          => $this['config']->get('oauth2.client.access_token_url'),
                    'urlResourceOwnerDetails' => $this['config']->get('oauth2.client.resource_owner_url'),
                ]);

                return $provider;
            }
        );
    }
764831
public function register()
    {
        $this->app->singleton('hipchat', function ($app) {
            return new Client(config('hipchat.api_token'), config('hipchat.server_url'));
        });

        $this->app->alias(Bestit\HipChat\Facade\HipChat::class, 'HipChat');
    }
460616
public function register()
	{
		$this->app['facebook'] = $this->app->share(function($app){
      return new Facebook($app['config']->get('facebook::secret'));
    });
	}
1368295
protected function registerAuth()
    {
        $this->app->singleton('api.auth', function ($app) {
            return new Auth($app[\Dingo\Api\Routing\Router::class], $app, $this->config('auth'));
        });
    }
417515
def init_app(self, app):
        """"""
        self.init_config(app)
        state = _OAuthClientState(app)
        app.extensions['invenio-oauthclient'] = state
        return state
613772
def register(
            self,
            app: 'Quart',
            first_registration: bool,
            *,
            url_prefix: Optional[str]=None,
    ) -> None:
        """"""
        state = self.make_setup_state(app, first_registration, url_prefix=url_prefix)

        if self.has_static_folder:
            state.add_url_rule(
                self.static_url_path + '/<path:filename>',
                view_func=self.send_static_file, endpoint='static',
            )

        for func in self.deferred_functions:
            func(state)
1003420
public function register()
    {
        $this->app->make(Auth::class)->extend('jwt', function ($app) {
            return new JWT($app->make(JWTAuth::class));
        });
    }