diff options
Diffstat (limited to 'internal/server/instituteaccess.go')
| -rw-r--r-- | internal/server/instituteaccess.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/server/instituteaccess.go b/internal/server/instituteaccess.go index 050e721..a51409f 100644 --- a/internal/server/instituteaccess.go +++ b/internal/server/instituteaccess.go @@ -1,6 +1,7 @@ package server import ( + "github.com/eduvpn/eduvpn-common/internal/discovery" "github.com/eduvpn/eduvpn-common/internal/oauth" "github.com/go-errors/errors" ) @@ -72,6 +73,27 @@ func (ias *InstituteAccessServer) OAuth() *oauth.OAuth { return &ias.Auth } +func (ias *InstituteAccessServer) RefreshEndpoints(_ *discovery.Discovery) error { + // Re-initialize the endpoints + b, err := ias.Base() + if err != nil { + return err + } + + err = b.InitializeEndpoints() + if err != nil { + return err + } + + // update OAuth + auth := ias.OAuth() + if auth != nil { + auth.BaseAuthorizationURL = b.Endpoints.API.V3.Authorization + auth.TokenURL = b.Endpoints.API.V3.Token + } + return nil +} + func (ias *InstituteAccessServer) init( url string, name map[string]string, |
