GithubHelp home page GithubHelp logo

microsoft-graph-training's Introduction

microsoft-graph-training's People

Contributors

alexbuckgit avatar alfredorevilla avatar cknizek avatar criticalsteffen avatar duncanma avatar isvargasmsft avatar jasonjoh avatar jreiss1923 avatar jthake-msft avatar matthewmcd avatar microsoft-github-policy-service[bot] avatar mrmitch avatar nellyk avatar nokafor avatar olivierdagenais avatar v-pegao avatar vsc-service-account avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

microsoft-graph-training's Issues

initialize_graph_for_user_auth

In the section "Add user authentication", there's a reference to a function initialize_graph_for_user_auth. It doesn't appear in the code, though. I suspect that's why I get errors like this:

azure.core.exceptions.ClientAuthenticationError: Couldn't begin authentication: AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials.

Got a token after device code login, now what?

I don't know if I managed to overlook something here, but I don't see any part in the tutorial or the code it shows that actually handles the token after the device code login.

There's code to show it, but that's it.

And I'm also not sure if I'm misinterpreting the tutorial but after the "Add user authentication" it acts as if we can just restart the program and it will NOT ask for a new device code login the next time. Which is what I'm running into.

I'd really like to know what I am supposed to do with the token and how I am supposed to reuse it, IF I am even supposed to be able to do so. The tutorial isn't even clear about this part.

Tutorial suggests using non-browsable constructor to create credential

Page: https://github.com/microsoftgraph/microsoft-graph-training/blob/main/tutorials/dotnet.yml

In the section titled "Configure Graph client for user authentication" of that page, under step 2 ("Add the following code to the GraphHelper class"), the code example suggest creating the credential using:

_deviceCodeCredential = new DeviceCodeCredential(deviceCodePrompt,
        settings.TenantId, settings.ClientId);

But that constructor is marked with the [EditorBrowsable(EditorBrowsableState.Never)] attribute in source: https://github.com/Azure/azure-sdk-for-net/blob/276e381fa973105926f1847181d6f141585722b3/sdk/identity/Azure.Identity/src/Credentials/DeviceCodeCredential.cs#L56-L57

which prevents it from showing up in intellisense:

image

image

or among the available constructors in MS Docs: https://learn.microsoft.com/en-us/dotnet/api/azure.identity.devicecodecredential.-ctor?view=azure-dotnet

Should we be suggesting new users to use constructors that we are hiding on purpose in source? Is there an alternative way to create the credential, without using a hidden constructor?

Typo for config.cfg

image
graphUserScopes should be like User.Read Mail.Read Mail.Send.
Currently in Azure Identity client library for Python scopes are case sensitive.

ODataError

I followed your Tutorial (https://learn.microsoft.com/en-us/graph/tutorials/python?tabs=aad).
When running the App, I can authenticate in the browser, and by clicking 1 and enter the access token gets displayed. Unfortunatly it is not possible to list the inbox and to send a mail. When trying to send a mail I get an error. The end of the Error says "msgraph.generated.models.o_data_errors.o_data_error.ODataError" I spent the last two days figuring out how to solve it but can't find a solution. All the Scopes are set correct, in the app and in the config.cfg file. I would be very thankful if someone could help me with that issue!

confusing

In the section setting up appSettings.js, the document says the following statements:

'tenantId': 'YOUR_TENANT_ID_HERE_IF_USING_APP_ONLY',
'authTenant': 'common',

authTenant If you chose the option to only allow users in your organization to sign in, change this value to your tenant ID. Otherwise leave as common.

On the previous page we configured the in Azure to support user authentication.
These for tenantId and authTenant are confusing. Do we:

  1. Leave tenantid blank because we're using user authentication?
  2. add the "tenant id" to authTenant?

Side note:
I've been struggling getting anything to work with Azure + Javascript for several weeks now. By itself it's a convoluted topic made more confusing because my organization decided to make it super complicated.

Azure portal App Registration page shows the following names Application (client) ID and Directory (tenant) ID. To further help avoid confusion it would be nice if the names in the document exactly matched where we get the information.

Cannot import name 'GraphRequestAdapter' from 'msgraph'

I tried this tutorial part https://learn.microsoft.com/en-us/graph/tutorials/python-app-only?tabs=aad but can not import GraphRequestAdapter

from msgraph import GraphRequestAdapter, GraphServiceClient
ImportError: cannot import name 'GraphRequestAdapter' from 'msgraph' (/home/user/venv/lib/python3.10/site-packages/msgraph/__init__.py)

Did there change something or what might be wrong? I installed the prerequesites as needed:

python3 -m pip install azure-identity
python3 -m pip install msgraph-core

Incorrect Value Used in Code for DotNet Tutorial

On the page: https://learn.microsoft.com/en-us/graph/tutorials/dotnet?tabs=aad&tutorial-step=3

image
The line:

_deviceCodeCredential = new DeviceCodeCredential(deviceCodePrompt,
        settings.AuthTenant, settings.ClientId);

is incorrect and should instead read:

_deviceCodeCredential = new DeviceCodeCredential(deviceCodePrompt,
            settings.TenantId, settings.ClientId);

Otherwise it doesn't tie to the tenant you're trying to log into.

I looked for the code directly to make a PR for it but was unable to locate it.

Error running "Display access token" command

On my first pass through the JavaScript tutorial, I got the following CLI error when performing step 4 in the section "Test the DeviceCodeCredential" of Add user authentication:

Select an option [1...5 / 0]: 1
undefined
Error getting user access token: AuthenticationRequiredError: invalid_grant: 7000014 - [2022-06-02 20:15:52Z]: AADSTS7000014: The provided value for the input parameter 'device_code' is not valid.
Trace ID: 28188046-9826-4c16-8083-3e6099d67200
Correlation ID: 2322d5dc-317e-464a-95e5-06b046b88670
Timestamp: 2022-06-02 20:15:52Z - Correlation ID: 2322d5dc-317e-464a-95e5-06b046b88670 - Trace ID: 28188046-9826-4c16-8083-3e6099d67200

Update Go tutorial samples to remove prefix

Related to microsoftgraph/msgraph-sdk-go#397

Remove the package prefix in query parameter structs in tutorial documentation for go. e.g Me from package"github.com/microsoftgraph/msgraph-sdk-go/me"
i.e

query := me.MeMailFoldersItemMessagesRequestBuilderGetQueryParameters

should be

query := me.MailFoldersItemMessagesRequestBuilderGetQueryParameters

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.