Giter Site home page Giter Site logo

Comments (5)

billba avatar billba commented on August 19, 2024 1

Secrets don't expire.

Tokens do expire, but are automatically renewed by DirectLineJS (unless there's a break in connection). This renewal is enabled by passing { token } when creating DirectLine.

from botframework-directlinejs.

billba avatar billba commented on August 19, 2024

Since you are using a secret, you should never get an expired token. Is it possible you are passing a token instead of a secret? That would explain the problem.

from botframework-directlinejs.

baki32 avatar baki32 commented on August 19, 2024

Hi,
thanks for reply, our setup is little bit more complicated - originally we were passing secret however we didn't want that to be exposed on the site so we started using azure API management. Now initial request is made with empty secret to Azure API management that adds secret to authorization header and then forwards to direct line api endpoint. Therefore I need to refresh the token when it expires (ideally I would like to prevent it from expiring in the first place)

from botframework-directlinejs.

baki32 avatar baki32 commented on August 19, 2024

Yes I figured, problem was API management after all. Refresh token method was intercepted and authorization header was being replaced with secret instead of token and it was resulting to that 403 error that had bad description (token expired).

from botframework-directlinejs.

morrisond91 avatar morrisond91 commented on August 19, 2024

@billba

Secrets don't expire. Tokens do expire, but are automatically renewed by DirectLineJS (unless there's a break in connection). This renewal is enabled by passing { token } when creating DirectLine.

Is this DirectLine default behaviour, or will the token only be generated if we are using webchat?

We are building a custom interface using directlinejs and the token is not being refreshed, so thinking that we need to do this manually.


We are not using web-chat, we have built our own react front end and using directlineJs.

We have an API that retrieves a token through https://directline.botframework.com/v3/directline/conversations. Upon API response we connect to DirectLine.

Everything works fine, however the token dies in 30 minutes and the conversation locks up.

What we are now trying to do is send a refresh message to https://directline.botframework.com/v3/directline/tokens/refresh passing in our original token, we get a new token back but are unsure what to do next?

from botframework-directlinejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.