Hey team, I have recently started getting the foll...
# ask-a-descoper
s
Hey team, I have recently started getting the following error when trying to perform OAuth for my Slack outbound app. This has not happened before. It was working perfectly and, out of nowhere, it started showing this error. Below is the code that led to the creation of the OAuth URL:
Copy code
async def initiate_connection(self, app_id: str, token: str, scopes: list[str] | None = None, redirect_url: str | None = None) -> str:
        url = "https://api.descope.com/v1/outbound/oauth/connect"
        headers = {"Content-Type": "application/json", "Authorization": f"Bearer {self.project_id}:{token}"}

        payload: dict[str, Any] = {
            "appId": app_id,
            "options": {
                # "redirectUrl": "http://localhost:3000",  # TODO: This should be configurable or come from settings
            },
        }
        if scopes:
            payload["options"]["scopes"] = scopes
        if redirect_url:
            payload["options"]["redirectUrl"] = redirect_url

        async with httpx.AsyncClient() as client:
            response = await client.post(url, headers=headers, json=payload)

        if response.status_code != 200:
            raise httpx.HTTPStatusError(f"Failed to initiate connection: {response.status_code} {response.text}", request=response.request, response=response)

        data = response.json()
        return data["url"]
The connection_url that descope provided is:
Copy code
https://slack.com/oauth/v2/authorize?access_type=offline&client_id=8701576852820.8983993557349&code_challenge=zflXhaO901Oc-UIz1eBl0YN2L3T0xJi3zBFJoA7nK7M&code_challenge_method=S256&prompt=consent&redirect_uri=https%3A%2F%2Fapi.descope.com%2Fv1%2Foutbound%2Foauth%2Fcallback&response_type=code&scope=app_mentions%3Aread+chat%3Awrite&state=os%2F54e38cc918aecba23fa2885afeba26300588610bb0e38e10ae5f6aba64a8cbf8&user_scope=channels%3Ahistory+channels%3Aread+chat%3Awrite+files%3Aread+files%3Awrite+groups%3Ahistory+groups%3Aread+im%3Ahistory+im%3Aread+im%3Awrite+mpim%3Ahistory+mpim%3Aread+mpim%3Awrite+search%3Aread+team%3Aread+users.profile%3Aread+users.profile%3Awrite+users%3Aread+users%3Aread.email
Has there been any change on your side that could explain this behaviour? Would greatly appreciate some help 🙏
m
@Tal Aharoni @Guy Pilosof @Rahul Rijhwani can you help here ?
👀 1
🙌 1
t
Hi, slack has changed their authorize endpoint to reject PKCE, we are working on a fix and will update you.
s
Thank you very much @Tal Kapitolnik 🙏
t
Hey @Sebastião Assunção, issue should be resolved. can you please try again?
s
It's working, golden 🫶 Thank you guys
👌 1