Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Last active September 25, 2024 18:55
Show Gist options
  • Select an option

  • Save wilmoore/fd34c84aaac311b8fb09fe21e11ea4ce to your computer and use it in GitHub Desktop.

Select an option

Save wilmoore/fd34c84aaac311b8fb09fe21e11ea4ce to your computer and use it in GitHub Desktop.
Software Engineering :: Web :: Development :: Authorization :: OAuth :: Flows :: Authorization Code Grant

Software Engineering :: Web :: Development :: Authorization :: OAuth :: Flows :: Authorization Code Grant

⪼ Made with 💜 by Polyglot.

related

Web Application w/ Server Backend

Native Mobile Application: PKCE (RFC 7636) is an extension to the Authorization Code flow to prevent CSRF and authorization code injection attacks.

BFF

The main benefit of using a BFF is the BFF's ability to act as a confidential client. Therefore, the BFF MUST act as a confidential client. Furthermore, the BFF SHOULD use the OAuth 2.0 Authorization Code grant with PKCE to initiate a request for an access token. Detailed recommendations for confidential clients can be found in oauth-security-topics Section 2.1.1.

image

sequenceDiagram
    User->>+Authorization Server: Request authorization
    Authorization Server->>+User: Redirect to login
    User->>+Authorization Server: Enter credentials
    Authorization Server->>+Client: Redirect with authorization code
    Client->>+Backend Server: authorization code
    Backend Server->>+Authorization Server: Request access token with authorization code
    Authorization Server->>+Backend Server: Provide access token
    Client->>Backend Server: Request resource with access token
    Backend Server->>Resource Server: Request resource with access token
    Resource Server->>Backend Server: Provide requested resource
    Backend Server->>Client: Provide requested resource

Guides


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment