Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting custom Authentication for SubscriptionServiceClient.Search and SubscriptionServiceClient.UpdateResults #2

Closed
jezzsantos opened this issue Mar 15, 2017 · 1 comment

Comments

@jezzsantos
Copy link
Owner

jezzsantos commented Mar 15, 2017

In practice, making a call to the remote subscription endpoints like:

  • GET /webhooks/subscriptions/search and
  • PUT /webhooks/subscriptions/history

is going to need some kind of authentication (i.e. session, token etc) for the remote service to authorize (based upon the WebhookFeature.SecureRelayRoles configuration).

If these endpoints are secured, then calls to SubscriptionServiceClient are going to need to support custom authentication in some way.

@jezzsantos
Copy link
Owner Author

jezzsantos commented Mar 15, 2017

Perhaps, we could simply provide a handler that will be called if a 401 is received, where the developer can put some code to perform the authentication first, and then it retries again, and this time fails.
(similar to ServiceClientBase)

i.e.

            container.Register<ISubscriptionService>(x => new SubscriptionServiceClient(appSettings)
            {
                ServiceClientFactory = x.Resolve<IEventServiceClientFactory>(),
                OnAuthenticationRequired = (serviceclient) =>
                {
                    //Do the required authN (to the remote SubscriptionService with another client instance)
                    // then set the cookies or bearertoken on the serviceclient
                },
            });

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

No branches or pull requests

1 participant