From 6d74934d18f345f2ffcbc219d13dd63a2f0b9810 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 4 Jan 2023 08:53:22 +0300 Subject: OAuth: allow HTTP Basic client authentication --- src/main/java/com/juick/www/api/Mastodon.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/juick/www') diff --git a/src/main/java/com/juick/www/api/Mastodon.java b/src/main/java/com/juick/www/api/Mastodon.java index 69f0f4f6..ff7f2e8c 100644 --- a/src/main/java/com/juick/www/api/Mastodon.java +++ b/src/main/java/com/juick/www/api/Mastodon.java @@ -34,6 +34,7 @@ import javax.inject.Inject; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.List; import java.util.UUID; @RestController @@ -84,7 +85,10 @@ public class Mastodon { .clientId(UUID.randomUUID().toString()) .clientSecret("{noop}" + secret) .clientName(clientName) - .clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_POST) + .clientAuthenticationMethods(coll -> coll.addAll(List.of( + ClientAuthenticationMethod.CLIENT_SECRET_POST, + ClientAuthenticationMethod.CLIENT_SECRET_BASIC + ))) .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE) .redirectUri(redirectUris) .scopes((coll) -> coll.addAll(parseScopes(scopes))) -- cgit v1.2.3