mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 01:02:14 +00:00
Remove deprecations in AuthorizationRequestRepository
Closes gh-11519
This commit is contained in:
parent
e12823095f
commit
0e291a3295
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2022 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.
|
||||
@ -56,19 +56,6 @@ public interface AuthorizationRequestRepository<T extends OAuth2AuthorizationReq
|
||||
*/
|
||||
void saveAuthorizationRequest(T authorizationRequest, HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* Removes and returns the {@link OAuth2AuthorizationRequest} associated to the
|
||||
* provided {@code HttpServletRequest} or if not available returns {@code null}.
|
||||
* @param request the {@code HttpServletRequest}
|
||||
* @return the removed {@link OAuth2AuthorizationRequest} or {@code null} if not
|
||||
* available
|
||||
* @deprecated Use
|
||||
* {@link #removeAuthorizationRequest(HttpServletRequest, HttpServletResponse)}
|
||||
* instead
|
||||
*/
|
||||
@Deprecated
|
||||
T removeAuthorizationRequest(HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* Removes and returns the {@link OAuth2AuthorizationRequest} associated to the
|
||||
* provided {@code HttpServletRequest} and {@code HttpServletResponse} or if not
|
||||
@ -78,8 +65,6 @@ public interface AuthorizationRequestRepository<T extends OAuth2AuthorizationReq
|
||||
* @return the {@link OAuth2AuthorizationRequest} or {@code null} if not available
|
||||
* @since 5.1
|
||||
*/
|
||||
default T removeAuthorizationRequest(HttpServletRequest request, HttpServletResponse response) {
|
||||
return removeAuthorizationRequest(request);
|
||||
}
|
||||
T removeAuthorizationRequest(HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2022 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.
|
||||
@ -81,8 +81,10 @@ public final class HttpSessionOAuth2AuthorizationRequestRepository
|
||||
}
|
||||
|
||||
@Override
|
||||
public OAuth2AuthorizationRequest removeAuthorizationRequest(HttpServletRequest request) {
|
||||
public OAuth2AuthorizationRequest removeAuthorizationRequest(HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Assert.notNull(request, "request cannot be null");
|
||||
Assert.notNull(response, "response cannot be null");
|
||||
String stateParameter = this.getStateParameter(request);
|
||||
if (stateParameter == null) {
|
||||
return null;
|
||||
@ -102,13 +104,6 @@ public final class HttpSessionOAuth2AuthorizationRequestRepository
|
||||
return originalRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OAuth2AuthorizationRequest removeAuthorizationRequest(HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Assert.notNull(response, "response cannot be null");
|
||||
return this.removeAuthorizationRequest(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the state parameter from the {@link HttpServletRequest}
|
||||
* @param request the request to use
|
||||
|
Loading…
x
Reference in New Issue
Block a user