diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-12-08 09:30:19 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-12-08 09:30:19 +0100 |
| commit | 37bca013bd4405548b274ac473acf959ad661ee6 (patch) | |
| tree | e8e4cfba6f46cabaa07a6c13ae9922ab344b89a5 | |
| parent | 5143ed35f2af2fe0e725c2a466c86f1cf929333c (diff) | |
OAuth: Comment fixes
Minor changes from PR #9
Co-authored-by: fkooman <fkooman@tuxed.net>
| -rw-r--r-- | internal/oauth/oauth.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/oauth/oauth.go b/internal/oauth/oauth.go index 6fd2c1f..802295d 100644 --- a/internal/oauth/oauth.go +++ b/internal/oauth/oauth.go @@ -79,7 +79,7 @@ func genVerifier() (string, error) { // OAuth defines the main structure for this package. type OAuth struct { - // ISS indicates the issuer indentifier of the authorization server as defined in RFC 9207 + // ISS indicates the issuer identifier of the authorization server as defined in RFC 9207 ISS string `json:"iss"` // BaseAuthorizationURL is the URL where authorization should take place @@ -103,10 +103,10 @@ type ExchangeSession struct { // ClientID is the ID of the OAuth client ClientID string - // ISS indicates the issuer inditifer + // ISS indicates the issuer identifier ISS string - // State is the expected URL state paremeter + // State is the expected URL state parameter State string // Verifier is the preimage of the challenge @@ -131,7 +131,7 @@ func (oauth *OAuth) AccessToken() (string, error) { // We have tokens... // The tokens are not expired yet - // So they should be valid, re-login not needed + // So they should be valid, re-authorization not needed if !tokens.Expired() { return tokens.access, nil } @@ -163,6 +163,8 @@ func (oauth *OAuth) AccessToken() (string, error) { // setupListener sets up an OAuth listener // If it was unsuccessful it returns an error. +// @see https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-07.html#section-8.4.2 +// "Loopback Interface Redirection". func (oauth *OAuth) setupListener() error { errorMessage := "failed setting up listener" oauth.session.Context = context.Background() |
