Skip to content

Commit

Permalink
docs: adds a sample for the authorization handler
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Sep 6, 2024
1 parent 86e092f commit e758956
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions middleware/AuthorizationHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,21 @@ Trap 401 responses and pass information in the `www-authenticate` header to help
## Performance Considerations

## Security Considerations

## Examples

### C#

```csharp
var deviceCodeCredentials = new DeviceCodeCredentials();
// simplest case MS Graph pre-packaged SDK
var client = new GraphServiceClient(deviceCodeCredentials);
var me = await client.Me.GetAsync();
// self-served client
var authenticationProvider = new AzureIdentityAuthenticationProvider(deviceCodeCredentials);
var requestAdapter = new HttpRequestAdapter(authenticationProvider);
var client = new MyCustomGraphClient(requestAdapter);
var me = await client.Me.GetAsync();
var httpClient = KiotaClientFactory.GetHttpClient(authenticationProvider); //this method is the http package
//... make an arbitrary request
```

0 comments on commit e758956

Please sign in to comment.