Philipp Mayer
10/14/2022, 10:55 AMPhilipp Mayer
10/14/2022, 10:56 AMdave
10/14/2022, 11:00 AMPhilipp Mayer
10/14/2022, 11:01 AM.then(ClientFilters.RefreshingOAuthToken(config, oAuthHttpClient))
dave
10/14/2022, 11:02 AMPhilipp Mayer
10/14/2022, 11:09 AMfun OAuthProvider.Companion.discord(client: HttpHandler, credentials: Credentials, callbackUri: Uri, oAuthPersistence: OAuthPersistence, scopes: List<String> = listOf()): OAuthProvider =
OAuthProvider(
OAuthProviderConfig(Uri.of("<https://discord.com>"), "/api/oauth2/authorize", "/api/oauth2/token", credentials, Uri.of("<https://discord.com>")),
client,
callbackUri,
scopes,
oAuthPersistence
)
Edit: I’m right now realizing that we always supplied the scope without any need for it. nvmPhilipp Mayer
10/14/2022, 11:27 AMdave
10/14/2022, 11:28 AMPhilipp Mayer
10/14/2022, 2:52 PMClientFilters.RefreshingOAuthToken(config, JavaHttpClient())
. 🤔
Can you elaborate? 😬
For reference:
fun ClientFilters.RefreshingOAuthToken(
config: OAuthProviderConfig,
backend: HttpHandler,
oAuthFlowFilter: Filter = ClientFilters.OAuthClientCredentials(config.credentials),
gracePeriod: Duration = Duration.ofSeconds(10),
clock: Clock = Clock.systemUTC()
) = ClientFilters.RefreshingOAuthToken(
config.credentials,
config.tokenUri,
backend,
oAuthFlowFilter,
gracePeriod,
clock
)
Philipp Mayer
10/14/2022, 4:59 PMdave
10/19/2022, 10:46 AMdave
10/19/2022, 10:47 AMPhilipp Mayer
10/19/2022, 11:36 AM