Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Missing SSOEndpoint for Sametime #1731

Closed
cifra2 opened this issue Nov 12, 2015 · 5 comments
Closed

Missing SSOEndpoint for Sametime #1731

cifra2 opened this issue Nov 12, 2015 · 5 comments

Comments

@cifra2
Copy link

cifra2 commented Nov 12, 2015

There is missing code for Sametime SSO login on Domino XPages. To be concrete - no SametimeSSOEndpoint and related code in SametimeClientRenderer (writeAutoLogin....)

@prb112
Copy link
Contributor

prb112 commented Nov 12, 2015

We are going to look at this, but no promise of a fix.

@cifra2
Copy link
Author

cifra2 commented Nov 13, 2015

fix would be simple.

  • add SametimeSSOEndpoint (with some small modifications its in my other question about HTTPS).
  • add methods to SametimeClientRenderer:
    protected void writeAutoLoginToken(FacesContext context, UIViewRootEx2 rootEx, UISametimeClient stClient, SSOEndpoint stServer) throws IOException {
        // TODO Auto-generated method stub

        boolean autoLogin = stClient.isAutoLogin();
        if (autoLogin) {
            try {
                if (stServer.isAuthenticated()) {
                    String status = stClient.getLoginStatus();
                    if (StringUtil.isEmpty(status)) {
                        status = "I'm available";
                    }
                    StringBuilder b = new StringBuilder(256);
                    b.append("function loggedIn(person) {\n");
                    b.append("console.debug(person.id + ' logged in successfully');\n");
                    b.append("}\n");
                    b.append("function errorHandler(reason, error) {\n");
                    b.append("console.debug('Error [' + error + ']: ' + reason);\n");
                    b.append("}\n");
                    b.append("stproxy.addOnLoad(function(){\n");
                    b.append("if(stproxy){stproxy.login.loginByToken(null");
                    b.append(",stproxy.status.AVAILABLE,'");
                    JavaScriptUtil.appendJavaScriptString(b, status);
                    b.append("',loggedIn, errorHandler)}\n");
                    b.append("});\n");
                    // b.append("dojo.addOnUnload(function(){if(stproxy){stproxy.login.logout(stproxy.session.USERID)}});\n");

                    rootEx.addScriptOnLoad(b.toString());
                }
            } catch (ClientServicesException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }

   protected JsonObject createProxyConfig(FacesContext context, UISametimeClient stClient, Endpoint stServer, String linkurl) throws IOException {
        // Get the proxy object in memory
        JsonObject proxyConfig = new JsonJavaObject();
        proxyConfig.putJsonProperty("server", stServer.getUrl());
        boolean autoTunnel = stClient.isAutoTunnelURI();
        if(autoTunnel) {
            //http://xxxx/xsp/.ibmxspres/.extlib/sbt/sametime/tunnel.html
            // Note that the URL must be absolute
            String htmlResource = FacesContext.getCurrentInstance().getExternalContext().encodeResourceURL(SBTResources.SAMETIME_TUNNEL_HTML);
            String tunnelURI = FacesUtil.makeUrlAbsolute(FacesContext.getCurrentInstance(), htmlResource);
            proxyConfig.putJsonProperty("tunnelURI", tunnelURI);
        }

        boolean connectClient = stClient.isConnectClient();
        if(connectClient) {
            proxyConfig.putJsonProperty("isConnectClient", connectClient);
        }

    if (stServer instanceof SSOEndpoint) 
        proxyConfig.putJsonProperty("tokenlogin", true);

        return proxyConfig;
    }

@prb112
Copy link
Contributor

prb112 commented Nov 14, 2015

At this time, we are not adding this endpoint. I suggest you extend the SSOEndpoint class in a downstream project

@prb112 prb112 closed this as completed Nov 14, 2015
@cifra2
Copy link
Author

cifra2 commented Nov 14, 2015

ok. So, you do not have plans to support SSO in SametimeClientRenderer in this SDK in the future?

@prb112
Copy link
Contributor

prb112 commented Nov 14, 2015

No plan to implement

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants