Example usage for com.liferay.portal.security.sso.openid.connect.constants OpenIdConnectWebKeys OPEN_ID_CONNECT_PROVIDER_NAMES

List of usage examples for com.liferay.portal.security.sso.openid.connect.constants OpenIdConnectWebKeys OPEN_ID_CONNECT_PROVIDER_NAMES

Introduction

In this page you can find the example usage for com.liferay.portal.security.sso.openid.connect.constants OpenIdConnectWebKeys OPEN_ID_CONNECT_PROVIDER_NAMES.

Prototype

String OPEN_ID_CONNECT_PROVIDER_NAMES

To view the source code for com.liferay.portal.security.sso.openid.connect.constants OpenIdConnectWebKeys OPEN_ID_CONNECT_PROVIDER_NAMES.

Click Source Link

Usage

From source file:com.liferay.login.authentication.openid.connect.web.internal.portlet.action.OpenIdConnectLoginRequestMVCRenderCommand.java

License:Open Source License

@Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {

    HttpServletRequest httpServletRequest = _portal.getHttpServletRequest(renderRequest);
    HttpServletResponse httpServletResponse = _portal.getHttpServletResponse(renderResponse);

    ThemeDisplay themeDisplay = (ThemeDisplay) httpServletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    if (!_openIdConnect.isEnabled(themeDisplay.getCompanyId()) || themeDisplay.isSignedIn()) {

        return "/login.jsp";
    }/*  w  ww .j a va 2 s  .  c  o  m*/

    Collection<String> openIdConnectProviderNames = _openIdConnectProviderRegistry
            .getOpenIdConnectProviderNames();

    httpServletRequest.setAttribute(OpenIdConnectWebKeys.OPEN_ID_CONNECT_PROVIDER_NAMES,
            openIdConnectProviderNames);

    RequestDispatcher requestDispatcher = _servletContext.getRequestDispatcher(_JSP_PATH);

    try {
        requestDispatcher.include(httpServletRequest, httpServletResponse);
    } catch (Exception e) {
        _log.error("Unable to include JSP " + _JSP_PATH, e);

        throw new PortletException("Unable to include JSP " + _JSP_PATH, e);
    }

    return "/navigation.jsp";
}