summaryrefslogtreecommitdiff
path: root/internal/api/api.go
diff options
context:
space:
mode:
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)