Gradient Mesh in Illustrator
- draw a rectangle
- select the Mesh Tool
- click one corner of the rectangle
- apply corner color
- Select the Direct Selection Tool
- Click another corner anchor and apply color
- repeat for remaining corners
There's no simple, one-click solution for a gradient of that nature.
Shape Layers in Photoshop
For Photoshop, the processes is much more cumbersome and involved and nowhere near as precise.
One method could be to use a separate shape/vector layer for each corner, then a solid filled shape as a base.
You basically set a gradient for each shape:
Then once you have the 4 shapes with Gradients change their blending modes to Darken. You don't absolutely need that bottom white rectangle I used. But things won't look quite right without a solid color (preferably white) background behind the gradient shape layers.
Another method for Photoshop could be to simply grab the Gradient Tool, set a color to transparent gradient and then drag from a corner. Repeat for each of the 4 colors. The problem with this method is that each time you drag, the length of the gradient will be different. So, you won't end up with 4 equal corner gradients. The Vector Layer/Shape Layer method ensures the gradients are all the same length.
In the end, I'd simply generate this in Illustrator and then copy/paste to Photoshop as a Smart Object.