Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Send extra parameters on reference token validation #129

Closed
jrcpereira opened this issue Nov 18, 2019 · 4 comments
Closed

Send extra parameters on reference token validation #129

jrcpereira opened this issue Nov 18, 2019 · 4 comments
Labels

Comments

@jrcpereira
Copy link

Hi!

Is there any way to pass extra parameters to Ids on token validation?

I would like to retain IP address and a timestamp for each token validated on Ids.
Since validation occurs server side, it would be great if we could pass additional parameters to the Ids endpoint.

Thanks!

@leastprivilege
Copy link
Member

You can inject your own HTTP message handler which could add data for outgoing calls..

@jrcpereira
Copy link
Author

jrcpereira commented Nov 27, 2019

Thanks for the hint!

Just to be sure I got it right... The best solution is to inject my message handler and create the HttpClient for introspection before the call to add IdentityServerAuthentication, right?

services.AddScoped<CustomHttpMessageHandler>(); services.AddHttpClient(OAuth2IntrospectionDefaults.BackChannelHttpClientName) .ConfigurePrimaryHttpMessageHandler<CustomHttpMessageHandler>();

@leastprivilege
Copy link
Member

It does not need to be the primary one - that's usually reserved for network config related things...

@jrcpereira
Copy link
Author

Despite I named it CustomHttpMessageHandler, I derived it from the HttpClientHandler.
But I will just add it as another handler to the HttpClient, just in case.

Thanks, once again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants