Just a few notes taken during development
OAuth 2.0 Specification, RFC6749
See https://superuser.com/a/226229
openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=DE/ST=NRW/L=Dortmund/O=STOPnik/CN=www.example.com" -keyout www.example.com.key -out www.example.com.cert
openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days 365 -nodes -x509 -subj "/C=DE/ST=NRW/L=Dortmund/O=STOPnik/CN=www.example.com" -keyout www.example.com.key -out www.example.com.cert
See How to generate RSA and EC keys with OpenSSL
openssl genrsa -out rsa256key.pem 3072
openssl ecparam -name prime256v1 -genkey -noout -out ecdsa256key.pem
openssl ecparam -name secp384r1 -genkey -noout -out ecdsa384key.pem
openssl ecparam -name secp521r1 -genkey -noout -out ecdsa521key.pem
openssl ecparam -list_curves
- Endpoint URL is out of scope, can be chosen by the implementation
- How identity of the user (resource owner) is validated is up to the implementation
- MUST support
GET
, MAY supportPOST
- Unknown parameters are skipped
- Request and response parameters MUST NOT not be included more then once
- Query of the URL (after
?
before#
) MAY beapplication/x-www-form-urlencoded
encoded response_type
is a required URL parameter, which is an enumeration ofcode
(authorization code grant) ortoken
(implicit grant)- SHOULD be TLS
Query parameter | Required | Comment |
---|---|---|
response_type | ☑️ | value is code |
client_id | ☑️ | |
redirect_uri | ✖️ | |
scope | ✖️ | |
state | ✖️ | |
code_challenge | ✖️ | PKCE |
code_challenge_method | ✖️ | PKCE |
Query parameter | Required | Comment |
---|---|---|
response_type | ☑️ | value is code |
client_id | ☑️ | |
redirect_uri | ✖️ | |
scope | ✖️ | |
state | ✖️ | |
code_challenge | ✖️ | PKCE |
code_challenge_method | ✖️ | PKCE |
- After successfully verifying the identity of the user (resource owner), the implementation redirects to either the configured (in some configuration) or provided (with
redirect_uri
parameter) URL - The URL for redirection is absolute
- Redirect with
Location
header
- HTTP
GET
/authorize (OAuth Authorization Request) - Show HTML page to login
- HTTP
POST
the login credentials (where ever the implementation needs to) - HTTP 302? response to redirect with
Location
header (OAuth Authorization Response)