public class CustomOAuthProvider : OAuthAuthorizationServerProvider { public override Task ValidateClientRedirectUri(OAuthValidateClientRedirectUriContext context) { // Get the redirect URI from the client var redirectUri = context.RedirectUri; // Get the registered URI for the client from the database var registeredUri = GetRegisteredUri(context.ClientId); // Compare the URIs if (redirectUri == registeredUri) { context.Validated(); } else { context.Rejected(); } return Task.FromResult