Hey everyone, total beginner here...
i'm trying to redirect to an external resource, and that url needs authentication to allow access.
what i'm trying to do is to
1.) redirect to externalURL.com/resource
2.) externalURL.com needs a username and password
3.) if the authorized, externalURL.com/resource is opened
4.) (the resource is a pdf)
It works when i use client->request, although here we're are not redirected to the resource:
$client = new Client();
$request = $client->request(
'GET',
'externalURL.com/resource',
[
'auth' => ['username', 'password', 'ntlm']
]
);
return $request->getStatusCode();
// 200
But when i use redirect it returns a 401 status:
return redirect(
'externalURL.com/resource',
301,
[
'auth' =>
['username', 'password', 'ntlm']
]
);
// 401
is it possible to pass along authentication parameters when using a redirect?
and is there a better way of doing this?