8000 GitHub - lithdew/oauth2-go: What does it take to write a minimal security-first OAuth 2.0 Server w/ OpenID Connect support in Go?
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

What does it take to write a minimal security-first OAuth 2.0 Server w/ OpenID Connect support in Go?

Notifications You must be signed in to change notification settings

lithdew/oauth2-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oauth2

IETF RFC 6749: OAuth 2.0

Security Considerations

  1. IETF RFC 6794 Section 1.4: Opaque access tokens
  2. IETF RFC 6819 Section 5.1.4.1.3: No Cleartext Storage of Credentials
  3. IETF RFC 6819 Section 5.1.4.1.4: Encryption of Credentials
  4. IETF RFC 6819 Section 5.1.5.2: Determine Expiration Time
  5. IETF RFC 6819 Section 5.1.5.3: Use Short Expiration Time
  6. IETF RFC 6819 Section 5.1.5.8: Bind Token to Client id
  7. IETF RFC 6819 Section 5.2.4.4: Binding of Authorization "code" to "client_id"
  8. IETF RFC 6819 Section 5.2.4.5: Binding of Authorization "code" to "redirect_uri"
  9. IETF RFC 7636: Proof Key for Code Exchange by OAuth Public Clients

Authorization codes, and access tokens are generated by generating 32 bytes using a cryptographically-secure PRNG, and passing it through HMAC-SHA256 with a secret key that is kept in the authorization server. The randomly-generated bytes and MAC are then individually BASE64-URL-encoded with no padding, and concatenated together with a "." delimiter.

base64_url_no_padding(prng_bytes).base64_url_no_padding(hmac_sha256(prng_bytes, secret_key))

All OAuth 2.0 client secrets are bcrypt-hashed with a cost of 10. The server supports client credentials being passed through either the HTTP Authorization header, or through the request body in the case the endpoint being queried supports being queried with url-encoded form data as a request body.

OAuth 2.0 Implicit Flow and Resource Owner Password Credentials Flow are intentionally not going to be supported as they are strongly advised against being used by recent IETF RFCs and several many identity providers.

About

What does it take to write a minimal security-first OAuth 2.0 Server w/ OpenID Connect support in Go?

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0