From 6b08c391d27a682ffece9e9c471986160e2f94af Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 9 Jan 2023 07:12:48 +0300 Subject: OAuth: update refresh token TTL --- src/main/java/com/juick/config/SecurityConfig.java | 1 - src/main/java/com/juick/www/api/Mastodon.java | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/juick/config/SecurityConfig.java b/src/main/java/com/juick/config/SecurityConfig.java index bb2a47cb..34e0a84d 100644 --- a/src/main/java/com/juick/config/SecurityConfig.java +++ b/src/main/java/com/juick/config/SecurityConfig.java @@ -20,7 +20,6 @@ package com.juick.config; import com.juick.KeystoreManager; import com.juick.service.ActivityPubService; import com.juick.service.UserService; -import com.juick.service.security.BearerTokenAuthenticationFilter; import com.juick.service.security.HTTPSignatureAuthenticationFilter; import com.juick.service.security.HashParamAuthenticationFilter; import com.juick.service.security.JuickUserDetailsService; diff --git a/src/main/java/com/juick/www/api/Mastodon.java b/src/main/java/com/juick/www/api/Mastodon.java index 3d31dcdf..af1c5ef7 100644 --- a/src/main/java/com/juick/www/api/Mastodon.java +++ b/src/main/java/com/juick/www/api/Mastodon.java @@ -118,7 +118,8 @@ public class Mastodon { .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE) .redirectUri(redirectUri) .scopes((coll) -> coll.addAll(parseScopes(scopes))) - .tokenSettings(TokenSettings.builder().accessTokenTimeToLive(Duration.ofDays(365)).build()) + .tokenSettings(TokenSettings.builder().accessTokenTimeToLive(Duration.ofDays(365)) + .refreshTokenTimeToLive(Duration.ofDays(365 * 5)).build()) .clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build()).build(); registeredClientRepository.save(registeredClient); return new ApplicationResponse( -- cgit v1.2.3