0 votes
1 view
Hello,

I am trying to implement direct login authentication for Knowage BI tool where user can directly access BI tool from our website's menu link.

Basically, what I want to implement is that if user click on the menu "Knowage BI" then session UserID and Password should be passed to Knowage tool and only shows that user's profile directly with out showing Knowage login screen.

I will be thankful, if I will get any suggestions to solve this issue.

Thank You,

Pritesh
Environment Knowage version: 6.0.0, OS: Windows 10
asked Mar 23, 2018 in API and SDK by priteshgondalia (490 points) | 1 view

3 Answers

0 votes
Best answer

You can see this example:

<script type="text/javascript">

        /*

         *  setup some basic informations in order to invoke Knowage server's services

         */

         

         var user = 'biuser';

         var password = 'biuser';

         

        Sbi.sdk.services.setBaseUrl({

            protocol: 'http'     

            , host: 'localhost'

            , port: '8080'

            , contextPath: 'knowage'

            , controllerPath: 'servlet/AdapterHTTP'  

        });

        

        

        execTest2 = function() {

            var html = Sbi.sdk.api.getDocumentHtml({

                documentLabel: 'par_document_label'

                , executionRole: '/spagobi/user'

                , parameters: {ELAB_ID: 'ELA_T_ANVOPOD_1', TIPO_AN_ID: 'ANVOFATT'}

                , displayToolbar: true

                , canResetParameters: false

                , iframe: {

                    height: '500px'

                    , width: '100%'

                    , style: 'border: 0px;'

                }

            });

            document.getElementById('targetDiv').innerHTML = html;

        };

      

            /*

            * the callback invoked uppon request termination

            *

            * @param result the server response

            * @param args parameters sent to the server with the original request

            * @param seccess true if the service has been executed by the server in a succesfull 

way

            */ 

            var cb = function(result, args, success) {

                

                if(success === true) {

                execTest2();

                } else {

                    alert('ERROR: Wrong username or password');

                }

            };

            

doLoginAndExecute = function() {

Sbi.sdk.api.authenticate({

params : {

user : user,

password : password

}

,

callback : {

fn : cb,

scope : this

}

});

};

</script>

more detail find from here:

https://github.com/KnowageLabs/Knowage-Server/blob/master/knowagesdk/src/main/webapp/

answered Jul 16, 2018 by kavenran (2,170 points)
selected Nov 9, 2018 by priteshgondalia
Hi,

Thank you for your reply.

Would you please explain how this should work? Because I do not exactly get this process.

Appreciated.

Thanks,
0 votes

Hi

actually you can send credentials to Knowage using POST method, USERNAME and PASSWORD parameters, this way you'll obtain a silent login.

Apart from that, I suggest you to have a look at threads in Integration, API and SDK and Single Sign-on categories, I'll find useful alternatives and information.

Hope this helps

Bye

answered Apr 17, 2018 by davide.zerbetto (2,260 points)
0 votes
Hi Pritesh,

Did you find a solution of this problem ?
answered Sep 19, 2018 by RahmaTeffahi (870 points)
Hi,

No, I have tried to send my credentials through POST method but was not successful in it. I am also trying to find another way like API to solve this problem.

If you can help me with this, it would be great.

Thanks,
Failed to load http://localhost:8080/knowage/servlet/AdapterHTTP?ACTION_NAME=LOGIN_ACTION_WEB&NEW_SESSION=TRUE: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63171' is therefore not allowed access.

This is the error I am getting.
1,555 questions
1,017 answers
2,038 comments
2,568 users