summaryrefslogtreecommitdiff
path: root/internal/api/api.go
diff options
context:
space:
mode:
authorJeroen Wijenbergh <jeroen.wijenbergh@geant.org>2026-02-12 11:14:39 +0100
committerJeroen Wijenbergh <jeroen.wijenbergh@geant.org>2026-02-12 11:14:46 +0100
commit026506786df47e805c926667887fae982283aa34 (patch)
treec52dc08ab8ac7c4e9817d3e449c456e1d3894b15 /internal/api/api.go
parent28c51a24570d742782c660167cef0d57e00d8bed (diff)
All: Use eduoauth-go v2 and update other deps
Diffstat (limited to 'internal/api/api.go')
-rw-r--r--internal/api/api.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/api/api.go b/internal/api/api.go
index c34a0b0..0d8e03c 100644
--- a/internal/api/api.go
+++ b/internal/api/api.go
@@ -11,7 +11,7 @@ import (
"net/url"
"time"
- "github.com/jwijenbergh/eduoauth-go"
+ "codeberg.org/jwijenbergh/eduoauth-go/v2"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"codeberg.org/eduVPN/eduvpn-common/internal/api/endpoints"
@@ -75,6 +75,11 @@ func NewAPI(ctx context.Context, clientID string, sd ServerData, cb Callbacks, t
// Construct OAuth
transp := sd.Transport()
+ post := true
+ // we do not support non-loopback clients with response_mode form_post
+ if cr != "" {
+ post = false
+ }
o := eduoauth.OAuth{
ClientID: clientID,
EndpointFunc: func(ctx context.Context) (*eduoauth.EndpointResponse, error) {
@@ -88,6 +93,7 @@ func NewAPI(ctx context.Context, clientID string, sd ServerData, cb Callbacks, t
}, nil
},
CustomRedirect: cr,
+ FormPost: post,
RedirectPath: "/callback",
TokensUpdated: func(tok eduoauth.Token) {
cb.TokensUpdated(sd.ID, sd.Type, tok)