Giter Site home page Giter Site logo

Support for http proxy about auth0-java HOT 7 CLOSED

sbityakov avatar sbityakov commented on June 16, 2024
Support for http proxy

from auth0-java.

Comments (7)

sbityakov avatar sbityakov commented on June 16, 2024 1

OK, thanks for the response. I'll roll my own for now.

from auth0-java.

jcd006 avatar jcd006 commented on June 16, 2024 1

@lbalmaceda We have a similar requirement to call Auth0 through a forward proxy for ManagementAPI and AuthAPI.

Can the httpclient be exposed through a constructor so that I can set my own proxy?

from auth0-java.

lbalmaceda avatar lbalmaceda commented on June 16, 2024

No, there's no current support for Proxy as I don't want to expose the OkHttp classes in the public API. Proxy class could be exposed as it's java.net, but if your proxy requires authentication you'd need to handle that error yourself. The way to do this using OkHttp is with a special Authenticator for the Proxy that sets the header in the request. We could create our own wrapper for that class and workaround it, but this is not a priority for us today.
I'll leave the issue open as a reminder. 👍

from auth0-java.

davet54321 avatar davet54321 commented on June 16, 2024

Would it be possible to solve this in 2 steps instead of 1. First step just expose ability to use proxy (without authentication). Second step handle the more complicated case of authenticated proxy.

I have a use case which needs a proxy (but not an authenticated one), so just solving the first case would be enough for me.

from auth0-java.

sappenin avatar sappenin commented on June 16, 2024

Echoing the request above, possibly doing something like this:

public ManagementAPI(String domain, String apiToken, OkHttpClient.Builder okHttpClientBuilder) {
        Asserts.assertNotNull(domain, "domain");
        Asserts.assertNotNull(apiToken, "api token");
        Asserts.assertNotNull(okHttpClientBuilder, "okHttpClientBuilder");

        this.baseUrl = createBaseUrl(domain);
        if (baseUrl == null) {
            throw new IllegalArgumentException("The domain had an invalid format and couldn't be parsed as an URL.");
        }
        this.apiToken = apiToken;

        telemetry = new TelemetryInterceptor();
        logging = new HttpLoggingInterceptor();
        logging.setLevel(Level.NONE);
        client = okHttpClientBuilder
                .addInterceptor(logging)
                .addInterceptor(telemetry)
                .build();
    }

from auth0-java.

jcd006 avatar jcd006 commented on June 16, 2024

@lbalmaceda I've raised another MR. #150 This one doesn't expose any okhttpclasses. It uses java.net.Proxy for proxy and java.net.PasswordAuthentication for proxy authentication.

from auth0-java.

stale avatar stale commented on June 16, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

from auth0-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.