diff --git a/src/css/style.css b/src/css/style.css index 80663b5..8ac19e6 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -42,7 +42,7 @@ body { /* Success Color */ .btn-success { - background-color: #33FF66; + background-color: #2e663c; } /* Text Color for Primary buttons */ diff --git a/src/flow/code-2.html b/src/flow/code-2.html index 100046a..751595d 100644 --- a/src/flow/code-2.html +++ b/src/flow/code-2.html @@ -74,10 +74,14 @@ the structure.

-

Now we have everything necessary to obtain token for the user. But is the state we have sent equivalent to the one we received back?

+

Now we have everything necessary to obtain token for the user. But is the state we have sent () equivalent to the one we received back ()?

- States are matching +
+ States are matching +
+
+ States are not matching +
@@ -91,14 +95,18 @@ + + diff --git a/src/flow/pkce-2.html b/src/flow/pkce-2.html index 8eb2329..c90dc6e 100644 --- a/src/flow/pkce-2.html +++ b/src/flow/pkce-2.html @@ -186,6 +186,7 @@ const state = generateSessionState(); const codeChallenge = getCookie("code_challenge"); + setCookie("pkce-state", state, 5); fillExample(); $("#sendRequestBtn").attr("href", constructRequestUrl()); diff --git a/src/flow/pkce-3.html b/src/flow/pkce-3.html index 51f2258..3eeef09 100644 --- a/src/flow/pkce-3.html +++ b/src/flow/pkce-3.html @@ -76,13 +76,6 @@ for CSRF protection.

-
  • -

    session_state=

    -

    The session state parameter is not a core part of the OAuth 2.0 specification, but it is used in OpenID Connect (OIDC) - to represent the state of the end user's session at the Authorization Server. - The client can use this value to help manage user sessions or to detect when the user's session at the Authorization - Server changes (for example, if the user logs out).

    -
  • code=

    The code parameter contains the actual authorization code. This is a temporary code that the client can exchange for an @@ -91,10 +84,17 @@ the structure.

  • -

    Now we have everything necessary to obtain token for the user. But is the state we have sent equivalent to the one we received back?

    +

    Now we have everything necessary to obtain token for the user. But is the state we have sent () equivalent to the one we received back ()?

    - States are matching +
    + States are + matching +
    +
    + States are not matching +
    @@ -108,16 +108,18 @@ + + + + + + + + +
    +
    +
    +

    WebAuthn

    +
    +
    + 1 +
    +
    +
    + 2 +
    +
    +
    + 3 +
    +
    +
    +
    + Build the authorization URL and redirect the user to the authorization server +
    +
    + After the user is redirected back to the client, verify that the state matches +
    +
    + Exchange the authorization code for an access token +
    +
    +
    +
    +
    +
    +
    +
    +
    1. Build the Authorization URL
    +

    + In order to initiate the Authorization Code Flow, we need to build the + authorization URL + and redirect the user to the authorization server. The URL is constructed as + follows: +

    +
    +

    Let's break it down...

    +
      +
    • +

      +

      +

      URL of the authorization endpoint on the server. How is this path constructed + will + differ between OAuth providers (such as Keycloak, Okta, etc.). +

      +
    • +
    • +

      response_type=

      +

      OAuth 2.0 response type. In this case, we are using the Authorization Code + flow, so + we are requesting the authorization code.

      +
    • +
    • +

      client_id= +

      +

      Client ID of the application. This is a public identifier for the client, and + it is + used by the authorization server to identify the application + when redirecting the user back to the client.

      +
    • +
    • +

      redirect_uri=

      +

      Redirect URI of the client. This is the URL that the authorization server + will + redirect the user back to after the user has logged in and + granted permissions. The redirect URI must match one of the URIs registered + for the + client ID.

      +
    • +
    • +

      scope=

      +

      Scopes requested by the client. Scopes are used to limit the access of the + access + token. In this case, we are requesting the offline_access scope, + which allows the client to obtain a refresh token.

      +
    • +
    • +

      state=

      +

      State parameter. This is an optional parameter that the client can use + to maintain + state between the request and callback. The authorization + server includes this parameter when redirecting the user back to the client, + allowing the client to verify that the response is coming from the + server and not a malicious third party (CSRF + attack).

      +
    • +
    +

    All that we now need to do is click the button below and login with our credentials. + For the purposes of this + playground we already took the liberty to create user with password + user for you. After your credentials are successfully verified, you will be + redirected back to this playground, to the URL we have specified in the + redirect_uri query parameter of the request.

    + +
    +
    +
    +
    +
    + +
    +
    + + + + + + + \ No newline at end of file diff --git a/src/index.html b/src/index.html index 6252088..50ba7d2 100644 --- a/src/index.html +++ b/src/index.html @@ -105,7 +105,7 @@
    -
    WebAuthN
    +
    WebAuthn

    This protocol leverages public key cryptography and allows users to authenticate using biometrics, mobile devices, or FIDO security keys, instead of traditional passwords. When a user registers with a website, a unique @@ -118,8 +118,8 @@ reliance on easily compromised passwords and defending against phishing attacks.

    -
    - build Under construction +
    + Try it
    diff --git a/src/sitemap.xml b/src/sitemap.xml index b4e7ae9..b5758a1 100644 --- a/src/sitemap.xml +++ b/src/sitemap.xml @@ -12,4 +12,10 @@ weekly 0.8 + + https://oauth-playground.online/flow/dag + 2023-09-26 + weekly + 0.8 +