我是否在symfony 3.4中以编程方式正确设置了授权标头

I have implemented OAuth into symfony 3.4. I can now use the access token and bearer in the authorize as shown below to authorize based upon an id. This works in postman.

PostMan Authorization example

However, the issue is when I come to programmatically send the same data in the authorization header in Symfony like shown in the code snippet below. It doesn't authorize though they are the same. Is this the correct way to setting the authorization header?

If I remove the authorization header above and depend on the code to authorize using the same credentials it will deny it.

I am confident everything is working accordingly. The issue is authorization using headers->set I believe

$request->headers->set('Authorization', 'Bearer NjBmMDg4M2I2NzkwZDRmZGVjN2VmYWNmNjQyMDg5Mzk1ZTAzZjQ0MzYyMmIzMDZjMjBlMjFlNzNkZTRhMDNhZA');