From 5f6de026a8d4339762ec63a20223b38d1cfb628e Mon Sep 17 00:00:00 2001 From: Asian Malaysian Vietnamese <71717525+talentedasian@users.noreply.github.com> Date: Fri, 7 May 2021 12:40:27 +0800 Subject: [PATCH] Update javadoc AuthorizationCodeOAuth2AuthorizedClientProvider Closes gh-9708 --- ...uthorizationCodeOAuth2AuthorizedClientProvider.java | 10 +++++++--- ...tionCodeReactiveOAuth2AuthorizedClientProvider.java | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/AuthorizationCodeOAuth2AuthorizedClientProvider.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/AuthorizationCodeOAuth2AuthorizedClientProvider.java index 2911fd90de..5ec0c85bf9 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/AuthorizationCodeOAuth2AuthorizedClientProvider.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/AuthorizationCodeOAuth2AuthorizedClientProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package org.springframework.security.oauth2.client; import org.springframework.lang.Nullable; import org.springframework.security.oauth2.client.registration.ClientRegistration; +import org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter; import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.util.Assert; @@ -39,8 +40,11 @@ public final class AuthorizationCodeOAuth2AuthorizedClientProvider implements OA * not {@link AuthorizationGrantType#AUTHORIZATION_CODE authorization_code} OR the * client is already authorized. * @param context the context that holds authorization-specific state for the client - * @return the {@link OAuth2AuthorizedClient} or {@code null} if authorization is not - * supported + * @return {@code null} if authorization is not supported or the client is already + * authorized + * @throws ClientAuthorizationRequiredException in order to trigger authorization in + * which the {@link OAuth2AuthorizationRequestRedirectFilter} will catch and initiate + * the authorization request */ @Override @Nullable diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/AuthorizationCodeReactiveOAuth2AuthorizedClientProvider.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/AuthorizationCodeReactiveOAuth2AuthorizedClientProvider.java index ab15fe304a..883f18a99a 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/AuthorizationCodeReactiveOAuth2AuthorizedClientProvider.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/AuthorizationCodeReactiveOAuth2AuthorizedClientProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package org.springframework.security.oauth2.client; import reactor.core.publisher.Mono; import org.springframework.security.oauth2.client.registration.ClientRegistration; +import org.springframework.security.oauth2.client.web.server.OAuth2AuthorizationRequestRedirectWebFilter; import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.util.Assert; @@ -41,8 +42,11 @@ public final class AuthorizationCodeReactiveOAuth2AuthorizedClientProvider * not {@link AuthorizationGrantType#AUTHORIZATION_CODE authorization_code} OR the * client is already authorized. * @param context the context that holds authorization-specific state for the client - * @return the {@link OAuth2AuthorizedClient} or an empty {@code Mono} if - * authorization is not supported + * @return an empty {@code Mono} if authorization is not supported or the client is + * already authorized + * @throws ClientAuthorizationRequiredException in order to trigger authorization in + * which the {@link OAuth2AuthorizationRequestRedirectWebFilter} will catch and + * initiate the authorization request */ @Override public Mono authorize(OAuth2AuthorizationContext context) {