nscendoni commented on code in PR #38:
URL:
https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/38#discussion_r2567683605
##########
src/main/java/org/apache/sling/auth/oauth_client/impl/OidcAuthenticationHandler.java:
##########
@@ -493,18 +493,34 @@ public boolean requestCredentials(@NotNull
HttpServletRequest request, @NotNull
} catch (IOException e) {
logger.error("Error while redirecting to default redirect: {}",
e.getMessage(), e);
throw new RuntimeException(e);
+ } catch (OAuthEntryPointException e) {
+ logger.warn("Invalid uri to redirect after login:: {}",
e.getMessage(), e);
+ throw new RuntimeException(e);
}
}
private @NotNull RedirectTarget getAuthenticationRequestUri(
- @NotNull ClientConnection connection, @NotNull HttpServletRequest
request, @NotNull URI callbackUri) {
+ @NotNull ClientConnection connection, @NotNull HttpServletRequest
request, @NotNull URI callbackUri)
+ throws OAuthEntryPointException {
ResolvedConnection conn = ResolvedOidcConnection.resolve(connection);
// The client ID provisioned by the OpenID provider when
// the client was registered is stored in the connection.
- String redirect = request.getRequestURI();
+ // Read if there is a parameter to the url where we need to redirect
the user after authentication
+ String redirect =
request.getParameter(RedirectHelper.PARAMETER_NAME_OIDC_REDIRECT);
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]