Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Asgardeo Java OIDC app redirection Issue #40

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public void sendForLogin(HttpServletRequest request, HttpServletResponse respons

HttpSession session = request.getSession();
RequestContext requestContext = defaultOIDCManager.sendForLogin(request, response);
if (request.getRequestURI() != null) {
String redirectPageURI = request.getRequestURI().substring(request.getContextPath().length() + 1);
requestContext.setParameter(SSOAgentConstants.REDIRECT_URI_KEY, redirectPageURI);
}
session.setAttribute(SSOAgentConstants.REQUEST_CONTEXT, requestContext);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ public class SSOAgentConstants {
public static final String CONSUMER_SECRET = "consumerSecret";
public static final String CALL_BACK_URL = "callBackURL";
public static final String SKIP_URIS = "skipURIs";
public static final String REDIRECT_URI_KEY = "redirectURI";
public static final String INDEX_PAGE = "indexPage";
public static final String ERROR_PAGE = "errorPage";
public static final String HOME_PAGE = "homePage";
public static final String LOGOUT_URL = "logoutURL";
public static final String SCOPE = "scope";
public static final String OAUTH2_GRANT_TYPE = "grantType";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ private void initConfig(Properties properties) throws SSOAgentClientException {
new Secret(properties.getProperty(SSOAgentConstants.CONSUMER_SECRET)) : null;
String indexPage = properties.getProperty(SSOAgentConstants.INDEX_PAGE);
String errorPage = properties.getProperty(SSOAgentConstants.ERROR_PAGE);
String homePage = properties.getProperty(SSOAgentConstants.HOME_PAGE);
String logoutURL = properties.getProperty(SSOAgentConstants.LOGOUT_URL);
JWSAlgorithm jwsAlgorithm =
StringUtils.isNotBlank(properties.getProperty(SSOAgentConstants.ID_TOKEN_SIGN_ALG)) ?
Expand Down Expand Up @@ -149,6 +150,7 @@ private void initConfig(Properties properties) throws SSOAgentClientException {
oidcAgentConfig.setConsumerSecret(consumerSecret);
oidcAgentConfig.setIndexPage(indexPage);
oidcAgentConfig.setErrorPage(errorPage);
oidcAgentConfig.setHomePage(homePage);
oidcAgentConfig.setLogoutURL(logoutURL);
oidcAgentConfig.setIssuer(issuer);
oidcAgentConfig.setSkipURIs(skipURIs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class OIDCAgentConfig {
private Secret consumerSecret;
private String indexPage;
private String errorPage;
private String homePage;
private String logoutURL;
private URI callbackUrl;
private Scope scope;
Expand Down Expand Up @@ -136,6 +137,26 @@ public void setErrorPage(String errorPage) {
this.errorPage = errorPage;
}

/**
* Returns the home page of the OIDC agent.
*
* @return Home page of the OIDC agent.
*/
public String getHomePage() {

return homePage;
}

/**
* Sets the home page for the OIDC agent.
*
* @param homePage The home page of the OIDC agent.
*/
public void setHomePage(String homePage) {

this.homePage = homePage;
}

/**
* Returns the logout URL of the OIDC agent.
*
Expand Down