• 17 Posts
  • 52 Comments
Joined 2 years ago
cake
Cake day: June 6th, 2023

help-circle
  • That’s bad.

    OAuth supports several types of flows. If I’m not mistaken (I’ve learned a bit more about OAuth since yesterday) you’re describing the Authorization Code Flow – as documented in RFC 6749 (The OAuth 2.0 Authorization Framework), Section 4.1 (Authorization Code Grant):

    That RFC defines many other types of flows that do not require sharing the access keys with a third party, such as the Client Credentials Flow, as documented in RFC 6749 Section 4.4 (Client Credentials Grant):

    The only reason you’d want to use the Authorization Code Flow is if the third party needs your access token for some reason, or if you want to hide the access key from the user agent.

    The problem here is that Stripe is using the wrong flow (the third party doesn’t need the access token, as they claim they never save it anyway). And if keyCloak only supports that one flow, that’s would be a problem too (in this case).


  • Upon further reading of RFC 6749, it appears that OAuth does require this – sometimes.

    It depends on the OAuth Flow. In this case, Stripe uses the “Authorization Code” Grant.

    This is documented in Stripe’s OAuth reference documentation here:

    curl https://connect.stripe.com/oauth/token \
      -u sk_test_MgvkTWK1jRG3olSRx9B7Mmxo: \
      -d “code”=”ac_123456789” \
      -d “grant_type”=”authorization_code”
    

    Authorization Code Grants are defined in RFC 6749 (The OAuth 2.0 Authorization Framework), Section 4.1 (Authorization Code Grant):

    To better understand why the OAuth Authorization Code Grant requires sharing the access token with a thrid party server, I found this article (Common OAuth Vulnerabilities) by Doyensec very elucidating:

    It says that the Authorization Code Flow is supposed to be used when you don’t want to share the tokens with the user agent.

    The Authorization Code Flow is one of the most widely used OAuth flows in web applications. Unlike the Implicit Flow, which requests the Access Token directly to the Authorization Server, the Authorization Code Flow introduces an intermediary step. In this process, the User Agent first retrieves an Authorization Code, which the application then exchanges, along with the Client Credentials, for an Access Token. This additional step ensures that only the Client Application has access to the Access Token, preventing the User Agent from ever seeing it.

    But this doesn’t make sense for this use-case. It appears Stripe is needlessly putting us at risk by choosing the Authorization Code Grant.





  • Thanks, but I don’t think this is the case here. The Authentication provider is Stripe (or, at least, it’s a stripe.com domain name). The 3rd party is the app developer’s server.

    Stripe’s infra is already PCI compliant.

    I’m not sure how a hardware security token would be relevant here. The end result must be something-you-know access token. Initial setup is done with 2FA, sure. But I don’t think the server can store (or emulate) a passkey. The issue here isn’t how I authenticate with Stripe. It’s after that – when Stripe gives the tokens to the third party (the dev’s server) and then the third party gives the token to my server. I don’t understand why Stripe doesn’t just let the devs implement it so Stripe gives the tokens directly to my server.





  • maltfield@lemmy.mlOPtoLemmy@lemmy.mlIntro Guide to Lemmy
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 years ago

    Suddenly my server started getting thousands of requests per minute and my varnish cache hit rate jumped to 99%. Thank god for varnish!

    Looks like the reddit blackout is #1 on the frontpage of hackernews, and this article is #2.

    I actually posted this article to hackernews, but I never got a single upvote. This isn’t my first time getting on the frontpage of hackernews, but it always happens when someone else reposts my link.

    Can anyone tell me how the fuck hackernews’ algorithm works to where I can’t ever get traction but someone else does after me?


















  • Honestly I’m not sure I’ll stick to lemmy if the amount of content doesn’t grow. And I’m sure I’m not alone. I’m here for news, and there’s very little coverage of world events on lemmy (though that has already noticeably improved as our userbase grows).

    I do want lemmy to grow, but not for growth’s sake. I want it to grow so the content (news article submissions and quality comments about those articles) grows.




    1. Downvotes are important to ensure quality content. It allows the community address statements made by a user based on objectively incorrect (mis)information. This feature is an important reason why many reddit users aren’t on Mastodon. Also, democracy is important.
    2. Recommended Instances shouldn’t wholesale block content just because it’s NSFW. As you say, policy on what NSFW content is allowed is distinct from the instance enabling NSFW content.
    3. People being able to create and moderate their own communities is positive

    If an instance (eg Hexbear) wants to deviate from this, that’s fine. That’s what the Fediverse is all about :) But we shouldn’t recommend those instances to new users as it will cause new user attrition.