Open Pdawg05 opened 1 year ago
It looks like one of these properties isn't present in the response from the Slack API for your user:
Any idea why those fields aren't being returned by the Slack API? I'm providing all the information I need to like ClientSecret/ClientId
Any idea why those fields aren't being returned by the Slack API? I'm providing all the information I need to like ClientSecret/ClientId
If I had to guess, I'd say it's not related to your Slack provider configuration, but either to your client registration at Slack or more likely to your user account. Try to intercept the userinfo response with Fiddler to see what field(s) is/are missing.
You can also give the OpenIddict Slack integration a try: it uses the newer OpenID Connect-based userinfo endpoint, which may return different information (see https://kevinchalet.com/2022/12/16/getting-started-with-the-openiddict-web-providers/ for an example with GitHub).
It could also the case that the code has always been wrong and incorrectly assumed those fields are always present and you’re just the first person to ever use it in a configuration where it isn’t in the response.
This is the exact request being sent to my callback URL
GET /signin-slack?code=5006616070674.5010877158211.408b2d23bbe3fd6a90eab49f4abfa8059f00ce2ed7f03360828ed7e7b5b30c8b&state=CfDJ8NtH7axWlrdOho9veL-jhtqLCtljXXOaDEdY0LiR6Tq_Pdyzn4rgLCyuT2dxzpigSd05UKGw3WmEfGs87Aku5Dl9icPA5Of76l0-MnWxtWSRiOa-NcaXvxgiFe7cACUb4WeKqtpqZ5MQgDjIdW8IqnptxNM8zNhWybCRx3WUODnbmXiLB9-ztI_ZqbgHWw8WsLIqE9cuBIbLtbpFRRpQsdY HTTP/2
Host: localhost:7138
Cookie: .AspNetCore.Correlation.E4ZQCWp6vRXooZMcA2BmZH9t7hLdLzbqgVWnRccsOEk=N; .AspNetCore.Correlation.c1US1hgIZBc99B06T8RQxmio47zoJAPmNFC5FRQaG2I=N; .AspNetCore.Correlation.53cqjvn8SyVq-sMJ-4Rc5Y5XtRLQolvLydTlWAZ5F6g=N; .AspNetCore.Correlation.yoWf2KcH7KttZje84kMs6gi1cTFLUUvozXWgWYWs4zE=N
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.5563.111 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Sec-Ch-Ua: "Chromium";v="111", "Not(A:Brand";v="8"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Windows"
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
So it looks like code and state are the only fields present... Will try the OpenIddict Slack Integration and compare the requests/see if that works.
The user document won’t be in that response.
That response is used to obtain the tokens so that your app can call the user information endpoint in the Slack API to get the information about you - that’s the response where the information is missing.
Tried your OpenIddict implementation and it worked perfectly. Thank you!!
Tried your OpenIddict implementation and it worked perfectly. Thank you!!
Nice. When you have a moment, please try to capture the userinfo request so we can determine whether there’s a bug in the Slack aspnet-contrib provider.
Describe the bug
I'm trying to implement OAuth with Slack in my ASP.NET 7 application. After the OAuth portal opens up and I login, a call back request is made to my
https://localhost:7138/signin-slack
endpoint. However, I then get this error.Steps To reproduce
My program.cs code:
Here's my controller:
Expected behaviour
The authentication looks like it was successful?? What is going on here?
Actual behaviour
Also I have no idea if this is worth mentioning, but obviously most of this code is from the sample Mvc.Client you guys provide in this repo. I noticed when I add Slack to the Startup.cs file and attempt to login I get a 500 Error. All the other OAuth providers seem to work fine for me though...
System information