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

WSO2 - OIDC_TOKEN_USE_BASIC_AUTH authorization code flow incompatibility #522

Open
filipeaaoliveira opened this issue Feb 16, 2024 · 0 comments

Comments

@filipeaaoliveira
Copy link

filipeaaoliveira commented Feb 16, 2024

Hello,

When implementing authorization code flow with a WSO2 server, even with the OIDC_TOKEN_USE_BASIC_AUTH = True, there is still a "The client MUST NOT use more than one authentication method" error.

I've manually removed the client_id from the payload in addition to client_secret and it works.

Is this a problem with how the WSO2 is configured, or has someone ran into the same issue?

Thank you.

    def get_token(self, payload):
        """Return token object as a dictionary."""

        auth = None
        if self.get_settings("OIDC_TOKEN_USE_BASIC_AUTH", False):
            # When Basic auth is defined, create the Auth Header and remove secret from payload.
            user = payload.get("client_id")
            pw = payload.get("client_secret")

            auth = HTTPBasicAuth(user, pw)
            del payload["client_secret"]
            del payload["client_id"] # This is what we changed.

        response = requests.post(
            self.OIDC_OP_TOKEN_ENDPOINT,
            data=payload,
            auth=auth,
            verify=self.get_settings("OIDC_VERIFY_SSL", True),
            timeout=self.get_settings("OIDC_TIMEOUT", None),
            proxies=self.get_settings("OIDC_PROXY", None),
        )
        self.raise_token_response_error(response)
        return response.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant