0

I am trying to build a client side app using javascript. I have the client id for the domain 'circuit.siemens.com'. Redirect_uri is set to the localhost:(port no.).

When the script hits client.Logon() it opens up a web page for logging in. Once the login is done it again redirects to the same login page. It never goes past after the login is successful.

What is the issue and how do I solve it?

I have posted my code below for further reference.

        debugger;
        let client = new Circuit.Client({
            client_id:'provided id',
            scope: 'ALL',
            domain: 'circuit.siemens.com',
            //redirect_uri: 'localhost:*****'
        });

        client.logon()
        .then(user => console.log(`Logged on as ${user.displayName}`, user))
        .then(() => client.getUsersByEmail(['participant email', 'participant email']))
        .then(users => users.map(user => user.userId))
        .then(userIds => client.createGroupConversation(userIds, 'runkit example'))
        .then(conv => client.addTextItem(conv.convId, 'Hi. What can I do for you?'))
        .then(client.logout)
        .catch(console.error)

        });
    });

</script>
Kaushik Makwana
  • 1,329
  • 2
  • 14
  • 24
R.Roy
  • 1
  • A couple questions: 1) What device/browser are you using? 2) Do you get the same behavior without defining a redirect_uri? 3) Are you including the latest circuit sdk (1.2.4903)? 4) Do you see the permissions popup after you login? – Roger Urscheler Jan 17 '19 at 12:15
  • 1) I am using Chrome Browser the test the code 2) Yes I get the same behaviour with or without the redirect_uri 3) Yes I am including the latest sdk from the src 4) Permissions only pops up the first time. The second time when it starts looping back the persmission do not pop up maybe because it already has access to the permissions – R.Roy Jan 18 '19 at 06:22
  • Not sure what's going on then. Can you try one of the jsbins (e.g. https://output.jsbin.com/dowopah)? If it works, then clone it and try it with your client_id. You can contact me via Circuit if you still have problems. – Roger Urscheler Jan 19 '19 at 02:31

0 Answers0