Skip to content

Commit

Permalink
Merge pull request #6807 from ORCID/TokenEndpointRedirectWithPath
Browse files Browse the repository at this point in the history
Redirect to the root endpoint with path /oauth/token
  • Loading branch information
amontenegro authored Jun 1, 2023
2 parents 60e8800 + f5cf809 commit 6291292
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,16 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import javax.ws.rs.core.Context;
import javax.ws.rs.ext.Provider;

import org.orcid.core.togglz.Features;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.beans.factory.annotation.Value;

import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;

import liquibase.repackaged.org.apache.commons.lang3.StringUtils;

@Provider
@Component
public class PutAuthTokenActionFilter extends OncePerRequestFilter {
Expand All @@ -43,7 +37,7 @@ public class PutAuthTokenActionFilter extends OncePerRequestFilter {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
if (Features.REDIRECT_PUT_TOKEN_ENDPOINT.isActive() && request.getRequestURI().contains(OAUTH_TOKEN_PATH)) {
response.setStatus(httpRedirectCode);
response.setHeader("Location", rootLocation);
response.setHeader("Location", rootLocation + OAUTH_TOKEN_PATH);
LOGGER.debug("Redirecting PUT token request to root");
}
else {
Expand Down

0 comments on commit 6291292

Please sign in to comment.