Closed ldkafka closed 8 months ago
I think the default Oauth2 client should (have at least the option to) set the Authorization header. According to the The OAuth 2.0 Authorization Framework RFC in the chapter Accessing Protected Resources:
The method in which the client utilizes the access token to authenticate with the resource server depends on the type of access token issued by the authorization server. Typically, it involves using the HTTP "Authorization" request header field ...
Yes, maybe. The issue here is that it will break compatibility with clients that do not override the method.
Latest Yii2 version, in yii2-authclient/src /OAuth2.php, Line 171
This is called from a BaseOAuth event in beforeApiRequestSend
The applyAccessTokenToRequest should either default to use Bearer Header Tokens, or be configurable like the the Server REST/Oauth2 implementations are configured with Authorization behaviour filters (of course using a method/attribute not filters).
Since most Oauth2/REST servers require Authorization Bearer Headers, how did this implementation ever work, or am I missing something?