Code Monkey home page Code Monkey logo

Comments (8)

martincostello avatar martincostello commented on June 11, 2024 1

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.

from aspnet.security.oauth.providers.

martincostello avatar martincostello commented on June 11, 2024

It looks like one of these properties isn't present in the response from the Slack API for your user:

string.Concat(user.GetProperty("team").GetString("id"), "|", user.GetProperty("user").GetString("id")));

from aspnet.security.oauth.providers.

Pdawg05 avatar Pdawg05 commented on June 11, 2024

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

from aspnet.security.oauth.providers.

kevinchalet avatar kevinchalet commented on June 11, 2024

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).

from aspnet.security.oauth.providers.

Pdawg05 avatar Pdawg05 commented on June 11, 2024

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.

from aspnet.security.oauth.providers.

martincostello avatar martincostello commented on June 11, 2024

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.

from aspnet.security.oauth.providers.

Pdawg05 avatar Pdawg05 commented on June 11, 2024

Tried your OpenIddict implementation and it worked perfectly. Thank you!!

from aspnet.security.oauth.providers.

kevinchalet avatar kevinchalet commented on June 11, 2024

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.

from aspnet.security.oauth.providers.

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.