Giter VIP home page Giter VIP logo

Comments (3)

gregurco avatar gregurco commented on June 18, 2024

Hello

@adpeyre could you please share more information? Where do you setup "verify"? Which client is used and which should be used? etc.

from guzzlebundleoauth2plugin.

adpeyre avatar adpeyre commented on June 18, 2024

Hello @gregurco !

I share my configuration, It's easier. :)

eight_points_guzzle:
    clients:
        erp:
            base_url: '%env(ERP_API_BASE_URL)%'
            # Request options: http://docs.guzzlephp.org/en/stable/request-options.html
            options:
                auth: oauth2
                verify: false

            # Find plugins here:
            # https://github.com/8p/EightPointsGuzzleBundle#known-and-supported-plugins
            plugin:
                # More information: https://packagist.org/packages/gregurco/guzzle-bundle-oauth2-plugin
                oauth2:
                    base_uri: '%env(ERP_API_OAUTH_BASE_URL)%'
                    token_url: "/connect/token"
                    client_id: '%env(ERP_API_OAUTH_CLIENT_ID)%'
                    client_secret: '%env(ERP_API_OAUTH_CLIENT_SECRET)%'
                    username: '%env(ERP_API_OAUTH_USERNAME)%'
                    password: '%env(ERP_API_OAUTH_PASSWORD)%'
                    #scope: "administration"
                    grant_type: "Sainsburys\\Guzzle\\Oauth2\\GrantType\\PasswordCredentials"
                    auth_location: 'body'
                    persistent: true

Curl options defined for the client (erp) are not used by the plugin.
For example, in this configuration, "verify: false" is not used by the OAuth2 plugin.

Is there a solution for that ?

from guzzlebundleoauth2plugin.

gregurco avatar gregurco commented on June 18, 2024

Hello @adpeyre

Sorry for late response. You described interesting case, but I'm not sure we have to apply all configurations from main client to the client used for authorization. I will think about that. As a quick solution you can check how client for authorization is defined: https://github.com/gregurco/GuzzleBundleOAuth2Plugin/blob/master/src/GuzzleBundleOAuth2Plugin.php#L69

You can easy redefine in your project this service with any configuration you want.

from guzzlebundleoauth2plugin.

Related Issues (9)

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.