You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> After pasting the code, make sure that the namespace in the *TokenProvider.cs* file matches the namespace of your project. This will allow you to more easily reference the `TokenProvider` class in your project.
273
+
274
+
The `TokenProvider` class defines a custom access token provider that executes the specified delegate method to get and return an access token.
275
+
239
276
Add the following new method to *MainPage.xaml.cs*:
240
277
241
278
```csharp
@@ -245,16 +282,22 @@ Add the following new method to *MainPage.xaml.cs*:
In this method, you're using the custom access token provider `TokenProvider` to connect the `SignInUserAndGetTokenUsingMSAL` method to the Microsoft Graph .NET SDK and create an authenticated client.
294
+
295
+
To use the `BaseBearerTokenAuthenticationProvider`, in the *MainPage.xaml.cs* file, add the following reference:
296
+
297
+
```cs
298
+
usingMicrosoft.Kiota.Abstractions.Authentication;
299
+
```
300
+
258
301
#### More information on making a REST call against a protected API
259
302
260
303
In this sample application, the `GetGraphServiceClient` method instantiates `GraphServiceClient` by using an access token. Then, `GraphServiceClient` is used to get the user's profile information from the **me** endpoint.
0 commit comments