Skip to content

New Graph v5.0+ broke my code #2396

Answered by Gruski
Gruski asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks that helped. Here is the code if someone else needs it.
Not sure why we must implement AllowedHostsValidator if it's never called internally by the API.

Imports Microsoft.Kiota.Abstractions.Authentication
Imports Microsoft.Graph
Imports Microsoft.Identity.Client
Imports System.Threading

Public Class GraphAPI
    'docs: https://github.com/microsoftgraph/msgraph-sdk-dotnet/tree/dev/docs

    Private Shared _client As GraphServiceClient   'shared among all requests

    Public Shared ReadOnly Property Client As GraphServiceClient
        Get
            If _client Is Nothing Then
                Dim authProvider = New BaseBearerTokenAuthenticationProvider(New TokenProvider())
       …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Gruski
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants