mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-25 05:47:57 +02:00
auth: generate oauth2 state randomly
This commit is contained in:
parent
4bf0f2c81d
commit
b169dd2cc4
2 changed files with 35 additions and 1 deletions
|
@ -50,7 +50,7 @@ var authCmd = &cobra.Command{
|
|||
// https://www.ietf.org/archive/id/draft-ietf-oauth-security-topics-22.html#name-countermeasures-6
|
||||
verifier := oauth2.GenerateVerifier()
|
||||
|
||||
state := "somestate" // FIXME: Should be a random string
|
||||
state := auth.RandomState()
|
||||
// Redirect user to consent page to ask for permission specified scopes.
|
||||
authUrl := strategy.AuthCodeURL(verifier, state)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue