Skip to content

Commit

Permalink
EPMRPP-90122 || It's not possible to configure any OAuth provider if …
Browse files Browse the repository at this point in the history
…ReportPortal deployed under path (#317)
  • Loading branch information
APiankouski committed Jul 5, 2024
1 parent ea5e31b commit 7477c9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javax.inject.Provider;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.security.core.Authentication;
Expand All @@ -42,6 +43,9 @@ public abstract class AuthSuccessHandler extends SimpleUrlAuthenticationSuccessH

private ApplicationEventPublisher eventPublisher;

@Value("${server.servlet.context-path:/uat}")
private String pathValue;

public AuthSuccessHandler(Provider<TokenServicesFacade> tokenServicesFacade,
ApplicationEventPublisher eventPublisher) {
super("/");
Expand All @@ -58,7 +62,7 @@ protected void handle(HttpServletRequest request, HttpServletResponse response,
query.add("token", token.getValue());
query.add("token_type", token.getTokenType());
URI rqUrl = UriComponentsBuilder.fromHttpRequest(new ServletServerHttpRequest(request))
.replacePath("/ui/authSuccess")
.replacePath(pathValue.replaceFirst("/uat", "") + "/ui/authSuccess")
.replaceQueryParams(query)
.build()
.toUri();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class SpringDocConfiguration {
@Value("${info.build.version}")
private String buildVersion;

@Value("${server.servlet.context-path:/api}")
@Value("${server.servlet.context-path:/uat}")
private String pathValue;

@Bean
Expand Down

0 comments on commit 7477c9d

Please sign in to comment.