Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authorize ¶
Authorize displays an HTML page for authorizing an application when the user has first been redirected to this path and generates a code and redirects to the app's callback URL after the user clicks "allow" on that page, which is detected via the origin and referer headers.
func Tokens ¶
func Tokens(db database.Store, lifetimes codersdk.SessionLifetime) http.HandlerFunc
Tokens TODO: the sessions lifetime config passed is for coder api tokens. Should there be a separate config for oauth2 tokens? They are related, but they are not the same.
Types ¶
type OAuth2ProviderAppSecret ¶
type OAuth2ProviderAppSecret struct { // Formatted contains the secret. This value is owned by the client, not the // server. It is formatted to include the prefix. Formatted string // Prefix is the ID of this secret owned by the server. When a client uses a // secret, this is the matching string to do a lookup on the hashed value. We // cannot use the hashed value directly because the server does not store the // salt. Prefix string // Hashed is the server stored hash(secret,salt,...). Used for verifying a // secret. Hashed string }
func GenerateSecret ¶
func GenerateSecret() (OAuth2ProviderAppSecret, error)
GenerateSecret generates a secret to be used as a client secret, refresh token, or authorization code.
Click to show internal directories.
Click to hide internal directories.