در حال بارگذاری ...

Private Package Authentication0:01

Most of the time your composer packages will install without any special configuration or authentication. But if you're dealing with private packages, you'll most often, especially if they're distributed by a third party, have to authenticate them using HTTP basic, which means your passing in a username and password along with a composer request. So what we'll do is we'll set up an HTTP basic section of our auth json file and we'll put the username and password in there.

Site-Level Auth Setup0:22

of our auth json file and we'll put the username and password in there. And then when we run Composer install, it'll just authenticate. Using that Forge makes it easy to build these auth json configurations both at the server and the site level. So first, let's take a look at what it looks like to manage it at the site level, which is similar to what we were looking at in our example here.

to manage it at the site level, which is similar to what we were looking at in our example here. So if we go to one of our sites and we go to Settings Composer, you see we can add Composer credentials here. So let's add our credential. You type the name of the repository, so nova dot layer val.com, you put in your username and then you pass in Nova Password here. And you can see I'm just typing that.

and then you pass in Nova Password here. And you can see I'm just typing that. And when you hit Add Credential, this is just gonna modify an auth J file in the web route of that site. So if we go over and we SHN, which site was this? This was lar cast tutorial dot on forge.com, SoCast tutorial, do on forge.com. If we look, we've got Auth Jason right there with those credentials that we just pasted in.

Auth During Site Creation1:23

If we look, we've got Auth Jason right there with those credentials that we just pasted in. So Forge just made it really easy for us to set up and manage multiple sets of those credentials without having to SSHN and getting that Js right. You can also do this if you want when you're creating a new site. So if we go back to our server and we hit new site, you can see that under the advanced settings we have the ability

Server-Level Composer Auth1:41

and we hit new site, you can see that under the advanced settings we have the ability to add package authentication here with those exact same settings. We can also handle this authentication at the server level. So if we go to our server and we go to PHP and Composer, they also have the exact same settings here, except this file is not gonna just apply for one site, it's gonna apply for your entire server. So let's do that larval com Nova password here,

it's gonna apply for your entire server. So let's do that larval com Nova password here, probably made a typo and that's fine. And so now when we go to that server, we can go to the dot config slash composer directory and you will see a file here called AU. That Jason, and that has this specific version with a little typo edges made, and it does prefill these as also potential options. But in general, anytime you are running Composer,

and it does prefill these as also potential options. But in general, anytime you are running Composer, install now on this server, you're gonna get the same authentication set up for you, not just on that one site.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟