https://github.com/identitymodel/identitymodel.aspnetcore.oauth2introspection
ASP.NET Core authentication handler for OAuth 2.0 token introspection
https://github.com/identitymodel/identitymodel.aspnetcore.oauth2introspection
Last synced: 3 months ago
JSON representation
ASP.NET Core authentication handler for OAuth 2.0 token introspection
- Host: GitHub
- URL: https://github.com/identitymodel/identitymodel.aspnetcore.oauth2introspection
- Owner: IdentityModel
- License: apache-2.0
- Created: 2015-12-26T20:47:25.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-09-09T06:04:21.000Z (10 months ago)
- Last Synced: 2025-04-11T23:14:55.838Z (3 months ago)
- Language: C#
- Homepage:
- Size: 295 KB
- Stars: 148
- Watchers: 10
- Forks: 69
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IdentityModel.AspNetCore.OAuth2Introspection
ASP.NET Core authentication handler for OAuth 2.0 token introspection
https://tools.ietf.org/html/rfc7662
## Configuration
```csharp
services.AddAuthentication(OAuth2IntrospectionDefaults.AuthenticationScheme)
.AddOAuth2Introspection(options =>
{
options.Authority = "https://base_address_of_token_service";options.ClientId = "client_id_for_introspection_endpoint";
options.ClientSecret = "client_secret_for_introspection_endpoint";
});
```## Configuring Backchannel HTTP Client
If configuration, such as using a proxy, is required for the HTTP client calling the Authority then it can be done by registering a named HTTP Client as follows
```csharp
services.AddHttpClient(OAuth2IntrospectionDefaults.BackChannelHttpClientName)
.AddHttpMessageHandler(() =>
{
//Configure client/handler for the back channel HTTP Client here
return new HttpClientHandler
{
UseProxy = true,
Proxy = new WebProxy(WebProxyUri, true)
};
}
```