1000 search results

Multiple Pages / Entries

…and... refresh! Bah: require is not defined Boo! My bad - I forgot to use the new built file. Open templates/bundles/FOSUserBundle/Security/login.html.twig. Point the script tag to build/login.js: And now... it works! When I type a really long username…

4:38
Test Fixtures & Fast Databases!

…the tutorial/ directory, you should have a DataFixtures directory. Copy that into your AppBundle. These two classes build 3 Enclosures and also add some security to them. But, part of this code is using a setEnclosure() method on Dinosaur... and that doesn't exist! Open…

7:18
Clearing the Database

…top of every test method. But another great option is to override setUp() and add it there. Let's empty all three entities: Enclosure, Security and Dinosaur. For this method to work, we need a getEntityManager() method. At the bottom, add private function getEntityManager(). Then…

6:19
Testing Exceptions

…puts the short name... so go copy the use statement and put it down here. Try it! Yes! One more test passing. I want to go through one more example next... and also add some security to the enclosures. Our guests have been terrorized enough.

4:32
PHPUnit: Secure the Park

…nothing! Just, "Welcome to Dinosaur Park". Instead of creating a park full of dinosaurs and then worrying about security... ahem... we don't have any code yet. We're going to build this dino factory and write tests all at the same time. The de…

5:43
Rock some FOSUserBundle!

…PHP web server. Ok, load this up in your browser: http://localhost:8000. Welcome to AquaNote! This is the same project we've been building in our main Symfony tutorials, but without any security logic. Gasp! See that Login link? It's a lie! It…

12:02
Event Hooks

…this is not the right use statement. I'll re-add TokenStorageInterface: make sure you choose the one from Security\Core\Authentication: In our method, fetch the user with $user = $this->tokenStorage->getToken()->getUser(). And if the User is not an instanceof our User…

6:15
Adding a Custom Action

…match what we put in the config: Notice the URL for this is just /genus/feed. It does not start with /easyadmin. And so, it's not protected by our access_control security. That should be enough to get started. Refresh! There's our link…

10:32
Live Webhook Testing with Ngrok

…into your browser! Ah, that's a little security check that prevents any non-local users from accessing our dev environment. Just for now, go into the web/ directory, open app_dev.php, and comment-out the two security lines: Refresh again! Hey, it's…

4:52
Webhook Endpoint Setup

…return the exact same data we already have? Yes! We do this not because we need to, but for security. If we read the request JSON directly, it's possible that the request is coming from some external, mean-spirited person instead of from Stripe…

3:58
Embedded Checkout Form

…is never, ever sent to our servers... which is the greatest news I have ever heard from a security standpoint. I do not want to handle your CC number: this would greatly increase the security requirements on my server. Instead, when you hit "Pay", this…

6:35
Mastering Route config Loading

…the next parts, we're going to start adding big features: like talking to a database, forms, security and more. And when we do, I've got some exciting news: because of your work here, it's all going to make sense. Let's keep…

4:15
Caching in the prod Environment Only

…along with security.yml and services.yml: The key point is that all of the files are just loading each other: it's all the same system. In fact, I could copy all of security.yml, paste it into config.yml, completely delete security.yml…

3:16
Using a Service

…best features of Twig is that it automatically escapes any HTML that you render. That gives you free security from XSS attacks. And for those few times when you do want to print HTML, just add the |raw filter: Refresh again: it's rending in…

3:04
Role Hierarchy

…s lame. Of course, you can solve this with that group system we talked about earlier, but that's usually overkill. And, there's a simpler way. In security.yml, let's take advantage of something called role hierarchies. It's simple, it's awesome!…

3:14
Doctrine Listener: Encode the User's Password

…do nothing: Now, on to encoding that password. Symfony comes with a built-in service that's really good at encoding passwords. It's called security.password_encoder and if you looked it up on debug:container, its class is UserPasswordEncoder. We'll need that…

4:39
Authenticator: getUser, checkCredentials & Success/Failure

…RouterInterface: Use the Option+Enter shortcut again to set up that property: Down in getLoginUrl(), return $this->router->generate('security_login'): So what happens when authentication is successful? It's awesome: the user is automatically redirected back to the last page they tried to visit…

6:31
Autowiring Madness

…thing I was talking about earlier. This will lead you to wonderful applications. There's really nothing that we can't do now in Symfony. In the next courses, we'll use all this to master new tools like forms and security. Seeya next time!

2:13
Service Autowiring

…a $robot property and set it: In checkCredentials(), if (!$this->robot->doesRobotAllowAccess()) then throw a really clear new CustomUserMessageAuthenticationException() that says "RANDOM SECURITY ROBOT SAYS NO!": And I'll even put quotes around that. This is when we would normally go to services.yml and…

4:52
New Profiler

…and open up DefaultController. Go down to sillyLoginAction(). OK, pretend that something went wrong and we can't figure it out. If this security.authentication_utils is the problem, we might want to use dump() to print it out. Below that, throw a new Exception…

3:06