|
@@ -13,7 +13,16 @@
|
|
|
* See the License for the specific language governing permissions and
|
|
|
* limitations under the License.
|
|
|
*/
|
|
|
-package org.springframework.security.oauth2.server.authorization.web;
|
|
|
+package org.springframework.security.oauth2.server.authorization.web.authentication;
|
|
|
+
|
|
|
+import java.net.URLDecoder;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
+import java.util.Base64;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.security.core.Authentication;
|
|
@@ -22,17 +31,10 @@ import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
|
|
|
import org.springframework.security.oauth2.core.OAuth2Error;
|
|
|
import org.springframework.security.oauth2.core.OAuth2ErrorCodes;
|
|
|
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2ClientAuthenticationToken;
|
|
|
+import org.springframework.security.oauth2.server.authorization.web.OAuth2ClientAuthenticationFilter;
|
|
|
import org.springframework.security.web.authentication.AuthenticationConverter;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.net.URLDecoder;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
-import java.util.Base64;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
/**
|
|
|
* Attempts to extract HTTP Basic credentials from {@link HttpServletRequest}
|
|
|
* and then converts to an {@link OAuth2ClientAuthenticationToken} used for authenticating the client.
|
|
@@ -40,10 +42,11 @@ import java.util.Map;
|
|
|
* @author Patryk Kostrzewa
|
|
|
* @author Joe Grandja
|
|
|
* @since 0.0.1
|
|
|
+ * @see AuthenticationConverter
|
|
|
* @see OAuth2ClientAuthenticationToken
|
|
|
* @see OAuth2ClientAuthenticationFilter
|
|
|
*/
|
|
|
-public class ClientSecretBasicAuthenticationConverter implements AuthenticationConverter {
|
|
|
+public final class ClientSecretBasicAuthenticationConverter implements AuthenticationConverter {
|
|
|
|
|
|
@Override
|
|
|
public Authentication convert(HttpServletRequest request) {
|
|
@@ -98,4 +101,5 @@ public class ClientSecretBasicAuthenticationConverter implements AuthenticationC
|
|
|
}
|
|
|
return additionalParameters;
|
|
|
}
|
|
|
+
|
|
|
}
|