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.certopenssl 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.certSee How to generate RSA and EC keys with OpenSSL
openssl genrsa -out rsa256key.pem 3072openssl ecparam -name prime256v1 -genkey -noout -out ecdsa256key.pemopenssl ecparam -name secp384r1 -genkey -noout -out ecdsa384key.pemopenssl ecparam -name secp521r1 -genkey -noout -out ecdsa521key.pemopenssl 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-urlencodedencoded response_typeis 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_uriparameter) URL - The URL for redirection is absolute
- Redirect with
Locationheader
- HTTP
GET/authorize (OAuth Authorization Request) - Show HTML page to login
- HTTP
POSTthe login credentials (where ever the implementation needs to) - HTTP 302? response to redirect with
Locationheader (OAuth Authorization Response)