GithubHelp home page GithubHelp logo

Comments (2)

jasonjoh avatar jasonjoh commented on June 15, 2024

Showing the token is basically to prove that the authentication worked! In a real app, there's no need to display the token.

With our Graph SDK, you don't need to manage tokens at all. The DeviceCodeCredential is wired to the Graph client object, and it handles requesting tokens as you make API calls.

When you restart the program, it will re-prompt you. That's because by default, the Azure Identity library uses an in-memory cache for tokens. Depending on which language you're working with, they provide mechanisms for you to allow it to cache to some persistent storage, which would eliminate the repeated prompts.

As for the "now what?" - if you've gotten a token, you should be good to proceed with the next steps of the tutorial.

from microsoft-graph-training.

BloodyRain2k avatar BloodyRain2k commented on June 15, 2024

I've looked into the whole thing a bit more and by now have a slightly better understanding how it works.
But as someone who literally just started with TypeScript and Graph I felt a little lost when I followed the tutorial and did manage to get the token but had to re-do the whole process each time I changed anything in the code.

I also managed to miss that this tutorial is available in more versions than TypeScript, that one's totally on me...

By now I know that the tokens don't even have a long lifetime in the first place and that they can't be reused anyways.
But since the tutorial just moved on without pointing out that it's normal to have re-doing the device code process each update, nor explaining why we're not storing the token in some form to get around that, I felt like I was missing something fundamental which threw me off.

from microsoft-graph-training.

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.