liveBook · Manning

Authorization endpoint

As explained in Spring Security in Action, Second Edition

An authorization endpoint is an OAuth endpoint where a client initiates an authorization request and a resource owner's authorization is obtained.

An authorization endpoint is where an OAuth client starts an authorization request and obtains the resource owner's authorization. In the authorization code flow, successful authentication leads to a redirect containing an authorization code, which the client exchanges for an access token. section 14.2

A request typically supplies:

  • response_type=code to select the authorization code grant type. section 14.2
  • client_id, scope, and a previously configured redirect_uri. section 14.2
  • A code_challenge and code_challenge_method when proof-key protection is used. section 14.2
Listing 14.7 The response of the OpenID configuration request
{
    "issuer": "http://localhost:8080",
    "authorization_endpoint": 
    "http://localhost:8080/oauth2/authorize",                     #1
    "token_endpoint": "http://localhost:8080/oauth2/token",       #2
    "token_endpoint_auth_methods_supported": [
        "client_secret_basic",
        "client_secret_post",
        "client_secret_jwt",
        "private_key_jwt"
    ],
    "jwks_uri": "http://localhost:8080/oauth2/jwks",              #3
    "userinfo_endpoint": "http://localhost:8080/userinfo",
    "response_types_supported": [
        "code"
    ],
    "grant_types_supported": [
        "authorization_code",
        "client_credentials",
        "refresh_token"
    ],
    "revocation_endpoint": "http://localhost:8080/oauth2/revoke",
    "revocation_endpoint_auth_methods_supported": [
        "client_secret_basic",
        "client_secret_post",
        "client_secret_jwt",
        "private_key_jwt"
    ],
    "introspection_endpoint": 
      "http://localhost:8080/oauth2/introspect",                  #4
    "introspection_endpoint_auth_methods_supported": [
        "client_secret_basic",
        "client_secret_post",
        "client_secret_jwt",
        "private_key_jwt"
    ],
    "subject_types_supported": [
        "public"
    ],
    "id_token_signing_alg_values_supported": [
        "RS256"
    ],
    "scopes_supported": [
        "openid"
    ]
}

Discover the authorization endpoint through the OpenID configuration response; the default path is /oauth2/authorize. section 14.2

Authorization request

http://localhost:8080/oauth2/authorize?response_type=code&client_id=client&scope=openid&redirect_uri=https://www.manning.com/authorized&code_challenge=...&code_challenge_method=S256 section 14.2

How Spring Security in Action, Second Edition covers it

How deep it goes
Explains default discovery, request parameters, login, redirect, and code issuance, but stops before implementing a custom endpoint.
Examples
Uses OpenID configuration discovery, a browser authorization URL, a login page, a redirect, and a token request.
What it assumes
Assumes a registered client and familiarity with the authorization code flow, while demonstrating the request sequence concretely.
What you can do after
Operate the authorization code flow by discovering the endpoint, submitting a request, and exchanging its returned code for a token.
How it connects
Connects authorization code grant, client registration, redirect URI, scope, PKCE, authentication, and access token issuance.

Also explained in

Compare how 3 books explain authorization endpoint →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring Security in Action, Second Edition. The section links point to the parts of the book it draws on.