Skip to content

Commit 85d6798

Browse files
TeksuSiKclaude
andcommitted
fix: introspectToken() uses app token in AuthMode.APP
introspectToken() defaulted to the user access token (getAccessToken()), which requires a token store and threw 'TokenStore is required' in app-only setups. It now selects the token based on the configured AuthMode: app token for AuthMode.APP, user token otherwise. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 274eab4 commit 85d6798

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/java/pl/teksusik/kick4j/authorization/AuthorizationClient.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,14 @@ public void revokeToken(String token, TokenTypeHint hint) {
229229

230230
/**
231231
* Introspects the current managed access token via the OAuth introspection endpoint.
232+
* Uses the app access token when the client is configured with {@link AuthMode#APP},
233+
* otherwise the user access token.
232234
*/
233235
public TokenIntrospect introspectToken() {
234-
return this.introspectToken(this.getAccessToken());
236+
String token = this.configuration.getAuthMode() == AuthMode.APP
237+
? this.getAppAccessToken()
238+
: this.getAccessToken();
239+
return this.introspectToken(token);
235240
}
236241

237242
/**

0 commit comments

Comments
 (0)