1000 search results

Using API Platform to build ticketing system (Antonio Peric-Mazar)

…Then you need to, only thing that you need to do is bin/console maker:user. You will get fully working user with everything setup in security and the only thing in rest API that you need to implement some action. For example, registration action…

38:25
Filtering Related Collections

…for more complex control, hiding fields based on the user, adding custom fields based on the user, validating data... again... based on who is logged in and even controlling database queries based on security. That... was awesome! In an upcoming tutorial, we'll talk about…

10:50
A "Normalizer Aware" Normalizer

…most importantly, it fixes our issue! Next, let's add the proper security logic to our class and then investigate another superpower of normalizers: the ability to add completely custom fields. We'll add a strange... but potentially useful boolean field to User called isMe.

6:49
Auto-set the Owner: Entity Listener

… To find the currently-authenticated user, add an __construct() method, type-hint the Security service and then press Alt + Enter and select "Initialize fields" to create that property and set it. Next, inside the method, start by seeing if the owner was already set: if…

9:46
Testing, Updating Roles & Refreshing Data

…the test environment, in order for Symfony's security system to "notice" that a user's roles were updated in the database, that user needs to log back in. It's a quirk of the security system and hopefully one we'll fix soon. Heck…

9:22
Relating Resources

…is no different than setting any other field. Later, once we have a real security system, we'll start locking things down so that I can't create a CheeseListing and say that someone else owns it. Anyways, to make owner part of our API…

7:38
User API Resource

…eventually store the encoded password, which is not something that an API client will set directly. But... we're going to worry about all of that in our security tutorial. For now, because password is a required field in the database, let's temporarily make…

7:20
Operations

…we'll learn about other, API-Platform-specific stuff that you can put here, like access_control for security and ways to control the serialization process. In fact, let's learn about that process right now! How does API Platform transform our CheeseListing object - with…

5:21
Autocomplete JavaScript

…until now, if we've wanted to add a class attribute, we've done it from inside of our Twig template. For example, open security/register.html.twig. For the form start tag, we're passing an attr variable with a class key. Or, for…

8:19
Redirecting on Success & the User Provider

…that info is loaded from the session and we're logged in. Cool! Look back at your security.yaml file. Remember this user provider thing that was setup for us? This is a class that helps with the process of loading the user info from…

6:17
Controller Functional Test

…piece of configuration. In your application, open config/packages/framework.yaml. Yep, right on top: the secret key. This is used in various places for security, and, since it needs to be unique and secret, Symfony can't give you a default value. For our…

9:14
Updating an Entity

…On a real site, I should only be able to like this article one time. But, we'll need to talk about users and security before we can do that. Now that this is working, we can improve it! In the controller, we wrote some…

7:37
Service Subscriber: Lazy Performance

…stuff. But then, in just a couple of places in Symfony, the main ones being Twig extensions, event subscribers and security voters - a few topics we'll talk about in the future - you should consider using a service subscriber instead to avoid a performance hit.

6:46
Testing a Form Submit

…use statement. Do the same for DinosaurFactory. Ok, it's happy! Sure, the code is lacking the normal security and safeguards we expect when using Symfony's form system... but it's only a dinosaur park people! We do, however, have the success flash message!…

5:56
CSRF Protection Part 2

…by requiring this header to always be set, we give our application a bit more security: it removes the possibility that's somebody could create a CSRF attack on that endpoint... or some future endpoint that we don't send any data to. In other…

7:39
ReactJS talks to your API

…sweet JavaScript. And we're just starting to scratch the surface of Symfony. What about talking to a database, using forms, setting up security or handling API input and validation? How and why should you register your own services? And what are event listeners? The…

5:13
Micro Symfony via MicroKernelTrait

…from Symfony's SecurityBundle... and we're not using that! If we need it, then you'll need to add it to LittleKernel and configure your security.yml file. For now, remove is_granted(): And try again. It alive... again! That's the MicroKernelTrait in…

9:06
Requiring Authentication

…re throwing an exception! But bad news, our exception is the one weird guy in the whole system: instead of being handled here, it’s handled somewhere else entirely. ApiEntryPoint: Where Security Responses are Created¶ Without getting too far into things, I’ve already written…

6:32
Implicit Grant Type with Google+

…Code grant type and redirecting the user, we only really need to worry about the JavaScript origins. Google makes us fill these in for security purposes - a topic we'll cover later. When we're finished, we have a brand new Client ID and secret…

9:45
Authorization Code Grant Type

…This parameter is absolutely necessary for the API request to work, but isn't actually used by COOP. It's a security measure, and it must exactly equal the original redirect_uri that we used when we redirected the user. Ok, let's try it…

10:23