-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
Status: In PRdocumentationImprovements or additions to documentationImprovements or additions to documentation
Description
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
Status: In PRdocumentationImprovements or additions to documentationImprovements or additions to documentation