Register any application authentication / authorization services.
559021
public function boot()
    {
        $this->registerPolicies();

        Gate::before(function (User $user, $ability) {
            return $user->isAdmin() ? true : null;
        });
    }
607174
protected function registerServiceProviders()
    {
        foreach ($this->serviceProviders[$this->flare->compatibility()] as $class) {
            $this->app->register($class);
        }
    }
835359
public function register()
    {
        parent::register();

        $this->registerConfig();

        $this->registerProvider(Providers\AuthorizationServiceProvider::class);

        $this->singleton(Contracts\Impersonator::class, Impersonator::class);
        $this->extendAuthDriver();
    }
193560
private function registerServiceBindings()
    {
        $this->set(KernelInterface::class, \DI\object(Kernel::class));
        $this->set(ConfigurationHandler::class, \DI\object(SharedConfiguration::class));
    }
435676
public function register()
  {
    $this->app->bind('acl', function($app){
      return new AclAdminControlPanel;
    });

    //Register dependency packages
    $this->app->register('Collective\Html\HtmlServiceProvider');
    $this->app->register('Intervention\Image\ImageServiceProvider');

    // Register dependancy aliases
    $this->app->booting(function()
    {
      $loader = \Illuminate\Foundation\AliasLoader::getInstance();
      $loader->alias('Form', 'Collective\Html\FormFacade');
      $loader->alias('HTML', 'Collective\Html\HtmlFacade');
      $loader->alias('Image', 'Intervention\Image\Facades\Image');
    });

  }
508501
public function register()
    {
        $this->app['httpauth'] = $this->app->share(function ($app) {
            return new Httpauth($app['config']->get('httpauth::config'));
        });
    }
1368295
protected function registerAuth()
    {
        $this->app->singleton('api.auth', function ($app) {
            return new Auth($app[\Dingo\Api\Routing\Router::class], $app, $this->config('auth'));
        });
    }
356157
public function register()
    {
        // merge default config
        $this->mergeConfigFrom(
            __DIR__.'/../../config/config.php',
            'httpauth'
        );

        $this->app->singleton('httpauth', function ($app) {
            return new Httpauth($app['config']->get('httpauth'));
        });
    }
1097835
protected function registerServices()
    {
        foreach ($this->serviceBindings as $key => $value) {
            is_numeric($key)
                    ? $this->app->singleton($value)
                    : $this->app->singleton($key, $value);
        }
    }
937518
def register(self):
        
        form = self._get_form('SECURITY_REGISTER_FORM')
        if form.validate_on_submit():
            user = self.security_service.user_manager.create(**form.to_dict())
            self.security_service.register_user(user)
            return self.redirect('SECURITY_POST_REGISTER_REDIRECT_ENDPOINT')

        return self.render('register',
                           register_user_form=form,
                           **self.security.run_ctx_processor('register'))
24001
protected function registerAuthorizationServer()
    {
        // The ResourceServer deals with authenticating requests, in other words validating tokens
        $this->app->when(ResourceServer::class)->needs('$publicKey')->give($this->getKey(self::KEY_PUBLIC));
        $this->app->bind(ResourceServer::class, function() {
            return $this->app->build(ResourceServer::class, [
                $this->app->make(AccessTokenRepositoryInterface::class),
                $this->getKey(self::KEY_PUBLIC),
                $this->app->make(DefaultValidator::class)
            ]);
        });

        // AuthorizationServer on the other hand deals with authorizing a session with a username and password and key and secret
        $this->app->when(AuthorizationServer::class)->needs('$privateKey')->give($this->getKey(self::KEY_PRIVATE));
        $this->app->when(AuthorizationServer::class)->needs('$publicKey')->give($this->getKey(self::KEY_PUBLIC));
        $this->app->when(AuthorizationServer::class)->needs(ResponseTypeInterface::class)->give(function() {
            return $this->app->make(IdTokenResponse::class);
        });

        $this->app->extend(AuthorizationServer::class, function (AuthorizationServer $server) {
            $server->setEncryptionKey($this->app->make('config/database')->get('concrete.security.token.encryption'));

            $oneHourTTL = new \DateInterval('PT1H');
            $oneDayTTL = new \DateInterval('P1D');


            $config = $this->app->make('config');

            if ($config->get('concrete.api.grant_types.password_credentials')) {
                $server->enableGrantType($this->app->make(PasswordGrant::class), $oneHourTTL);
            }
            if ($config->get('concrete.api.grant_types.client_credentials')) {
                $server->enableGrantType($this->app->make(ClientCredentialsGrant::class), $oneHourTTL);
            }
            if ($config->get('concrete.api.grant_types.authorization_code')) {
                $server->enableGrantType($this->app->make(AuthCodeGrant::class, ['authCodeTTL' => $oneDayTTL]), $oneDayTTL);
            }
            return $server;
        });

        // Register OAuth stuff
        $this->app->bind(AccessTokenRepositoryInterface::class, $this->repositoryFor(AccessToken::class));
        $this->app->bind(AuthCodeRepositoryInterface::class, $this->repositoryFor(AuthCode::class));
        $this->app->bind(ClientRepositoryInterface::class, $this->repositoryFor(Client::class));
        $this->app->bind(RefreshTokenRepositoryInterface::class, $this->repositoryFor(RefreshToken::class));
        $this->app->bind(ScopeRepositoryInterface::class, $this->repositoryFor(Scope::class));
        $this->app->bind(UserRepositoryInterface::class, $this->repositoryFactory(UserRepository::class, User::class));
    }
317922
public function register()
    {
        foreach ($this->commands as $binding => $command) {
            $bind    = $this->prefix . $binding;
            $command = '\\' . $this->namespace . '\\' . $command . $this->commandSuffix;
            unset($this->commands[ $binding ]);
            $this->commands[ $bind ] = $command;
            $this->app->singleton($bind, $command);
        }

        $this->commands(array_keys($this->commands));
    }
165843
public function register()
    {
        $this->bindGuzzle();

        $this->bindAuth();

        $this->bindHttpClient();

        $this->bindApiClient();

        $this->bindTaxonomyMapper();
    }
580366
public function boot()
    {
        $this->registerPolicies();

        // Dynamically register permissions with Laravel's Gate.
        foreach ($this->getPermissions() as $permission) {
            Gate::define($permission->name, function (User $user) use ($permission) {
                return $user->hasPermission($permission);
            });
        }
    }
949264
protected function registerAuthorizationService()
    {
        $overrulingPriority = $this->getHighestAuthenticationServicePriority() + 1;

        ExtensionManagementUtility::addService(
            'solr', // extension key
            'auth', // service type
            AuthorizationService::class,
            // service key
            [// service meta data
                'title' => 'Solr Indexer Authorization',
                'description' => 'Authorizes the Solr Index Queue indexer to access protected pages.',

                'subtype' => 'getUserFE,authUserFE,getGroupsFE',

                'available' => true,
                'priority' => $overrulingPriority,
                'quality' => 100,

                'os' => '',
                'exec' => '',

                'classFile' => ExtensionManagementUtility::extPath('solr') . 'Classes/IndexQueue/FrontendHelper/AuthorizationService.php',
                'className' => AuthorizationService::class,
            ]
        );
    }
757012
public function register()
    {
        // if php on server, run router
        if (isset($_SERVER['HTTP_HOST'])) {
            include ROUTE_PHP;
            $router = new Router(App::make('http.request'));
            $router->run();
        }

        $cookies = new UseCookieHeaders();
        $cookies->useCookies();
    }
701250
public function register() {
		// if the provider method exists then we are at least in Laravel 5.1
		if(method_exists('Illuminate\Auth\AuthManager', 'provider')) {
			// LDAP auth extension
			Auth::provider('ldap', function($app, array $config) {
				return new \CSUNMetaLab\Authentication\Providers\UserProviderLDAP();
			});

			// database auth extension
			Auth::provider('dbauth', function($app, array $config) {
				return new \CSUNMetaLab\Authentication\Providers\UserProviderDB();
			});
		}
		else
		{
			// Laravel 5.0
			Auth::extend('ldap', function() {
				return new Guard(new \CSUNMetaLab\Authentication\Providers\UserProviderLDAP,
					App::make('session.store'));
			});
			Auth::extend('dbauth', function() {
				return new Guard(new \CSUNMetaLab\Authentication\Providers\UserProviderDB,
					App::make('session.store'));
			});
		}
	}