Skip to content

Repository files navigation

OAuth2 Client Handler

Build status

Managed .NET library for use with HttpClient to transparantly call authorized remote API protected with OAuth2 or OpenID Connect.

Supports .NET Framework 4.5+ and .NET Standard / .NET Core.

Get it on NuGet

PM> Install-Package OAuth2ClientHandler

Usage

varoptions=newOAuthHttpHandlerOptions{AuthorizerOptions=newAuthorizerOptions{AuthorizeEndpointUrl=newUri("http://localhost/authorizer"),TokenEndpointUrl=newUri("http://localhost/token"),ClientId="MyId",ClientSecret="MySecret",GrantType=GrantType.ClientCredentials}};using(varclient=newHttpClient(newOAuthHttpHandler(options))){client.BaseAddress=newUri("http://localhost");varresponse=awaitclient.GetAsync("/api/protected_api_call");// ...}

About

Managed .NET (C#) library for use with HttpClient to transparantly call authorized WebAPI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages