collado-mike commented on code in PR #952:
URL: https://github.com/apache/polaris/pull/952#discussion_r1947048966
##########
service/common/src/main/java/org/apache/polaris/service/auth/DefaultOAuth2ApiService.java:
##########
@@ -75,43 +74,39 @@ public Response getToken(
if (!tokenBroker.supportsRequestedTokenType(requestedTokenType)) {
return
OAuthUtils.getResponseFromError(OAuthTokenErrorResponse.Error.invalid_request);
}
- if (authHeader == null && clientId == null) {
+ if (authHeader == null && clientSecret == null) {
return
OAuthUtils.getResponseFromError(OAuthTokenErrorResponse.Error.invalid_client);
}
- if (authHeader != null && clientId == null && authHeader.startsWith("Basic
")) {
+ // token exchange with client id and client secret means the client has
previously
+ // attempted to refresh an access token, but refreshing was not supported
by the token broker.
+ // Accept the client id and secret and treat it as a new token request
+ if (authHeader != null && clientSecret == null &&
authHeader.startsWith("Basic ")) {
Review Comment:
> Sorry, but I'm not sure how this logic aligns with the comment above.
"With ... client secret", but the secret is `null` here?... Would you mind
clarifying the comment?
I actually just moved the comment from below. But I'll add that the clientId
and secret come from the auth header in this case.
https://github.com/apache/polaris/pull/952/files/4cd4130b286d327428bc660e3731234561ab0d1e#diff-3e1d745f65cde4f3699177beac21b387a0346daef83978ec835c7037ddb9b8baL100
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]