Using restricted Help Center content with the Web Widget

Have more questions? Submit a request

35 Comments

  • Chris Stock
    Comment actions Permalink

    Hi there, is it possible to verify the JWT somehow? My server side code is returning a jwt, and I'm passing it to authenticate, but my widget is only returning public articles.

    Is there a way to check whether my jwt is valid?

    0
  • Raviraj Patel
    Comment actions Permalink

    Hi there,
    I have followed all the steps as mentioned in the article but facing an error for the Authentication. How to validate JWT token as there's not a sample for .Net in case I am missing anything.

     

    Thanks,

    1
  • Bryan Flynn
    Comment actions Permalink

    One thing Raviraj Patel to check is make sure the generated JWT is valid. You can paste it into  https://jwt.io/ and see if it's valid. Otherwise, providing more specific errors from the your browser's network tab and console might be a good next step.

    0
  • Ramesh Doddi
    Comment actions Permalink

    Hello, Server side (Rails) eg.

    current_time = Time.now

    payload = {:name => current_user.name,:email => current_user.email,:iat => current_time.to_i,:external_id => current_user.id,:exp => (current_time + 1.minutes).to_i}
    jwt = JsonWebToken.encode(payload,token id,current_time)
     
    frontend (angular)  i added required code snippet shared in the documentation. eg
     
    window.zESettings = webWidget: authenticate: chat: jwtFn: (callback) ->
      fetch(xxxxxxxxxxxxxxxxx/gettoken.json?id='+ vm.employee.id).then (res) ->
         res.json().then (jwt) ->
             callback jwt
             return
            return
        return  
     
    But jwFn function never get executed to get token from my backend. could you please help if i miss anything??
     
    0
  • co log
    Comment actions Permalink

    Im getting exception console "j.createHmac is not a function" in reactjs application.

     

    what are alternatives for jwt.package?

     

    Could you please help me to fix this ?

     

    2

Please sign in to leave a comment.

Powered by Zendesk