You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And I discovered that if I try to reach v2/foo route, I get errors log
Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\HttpException: "Full authentication is required to access this resource." at ExceptionListener.php line 232
and
No Authentication entry point configured, returning a 401 HTTP response. Configure "entry_point" on the firewall "api_oauth" if you want to modify the response.
Re-reading the doc, I think it's because I was missing oauth2: true on the api_oauth firewall, this option seems to use the OAuth2Authenticator and solve the "No Authentication entry point configured" error. But I soon as I use this option, the page go from
to
I assume it's because of the code
public function start(Request $request, ?AuthenticationException $authException = null): Response
{
return new Response('', 401, ['WWW-Authenticate' => 'Bearer']);
}
Wouldn't it better to still have the symfony-profiler/debug tools in debug mode ? Is it possible ?
Also, why my custom 401 error page is not used ?
Wouldn't it better to rely on Symfony Exception listener and throw an AuthenticationException in the start method rather than
new Response('', 401, ['WWW-Authenticate' => 'Bearer']);
Something like a OAuth2AuthenticationException ?
The text was updated successfully, but these errors were encountered:
Hi @chalasr ,
This bundle is great and simplify the integration of oauth. Thanks a lot.
But I ended up with some questions.
We're having our firewall config done this way:
And I discovered that if I try to reach
v2/foo
route, I get errors logand
Re-reading the doc, I think it's because I was missing
oauth2: true
on theapi_oauth
firewall, this option seems to use theOAuth2Authenticator
and solve the "No Authentication entry point configured" error. But I soon as I use this option, the page go fromto
I assume it's because of the code
Wouldn't it better to still have the symfony-profiler/debug tools in debug mode ? Is it possible ?
Also, why my custom 401 error page is not used ?
Wouldn't it better to rely on Symfony Exception listener and throw an
AuthenticationException
in the start method rather thanSomething like a
OAuth2AuthenticationException
?The text was updated successfully, but these errors were encountered: