Skip to content

Update public docs with information about proxy authentication #127

@rkodev

Description

@rkodev

We just added support for proxy authentication and would like to update the public docs with the same. This is how a user can construct a client that uses proxy authentication

import (
   a "github.com/microsoft/kiota-authentication-azure-go"
   khttp "github.com/microsoft/kiota-http-go"
   msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
   core "github.com/microsoftgraph/msgraph-sdk-go-core"
)

// Auth provider
auth, err := a.NewAzureIdentityAuthenticationProviderWithScopes(...)

// Get default middleware from SDK
defaultMiddleware := core.GetDefaultMiddlewaresWithOptions(msgraphsdk.GetDefaultClientOptions())

// Get instance of custom middleware
// Implement a custom middleware by implementing the Middleware interface
// https://github.com/microsoft/kiota-http-go/blob/main/middleware.go
allMiddleware := append(defaultMiddleware, mycustom.NewCustomHandler())

// Create an HTTP client with the middleware
httpClient := core.GetClientWithAuthenticatedProxySettings("http:://proxy-url", "username", "password", allMiddleware...)

// A client that does not require user and password auth can use
httpClient := core.GetClientWithProxySettings("http:://proxy-url", allMiddleware...)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions