Skip to content

Commit

Permalink
Dual context as first step alone can use all 30s
Browse files Browse the repository at this point in the history
  • Loading branch information
satyamsi committed Sep 8, 2023
1 parent 11e31e7 commit 7ca9245
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/a3sctl/internal/authcmd/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func makeOIDCCmd(mmaker manipcli.ManipulatorMaker, restrictions *permissions.Res

go startOIDCCallbackServer(srvCtx, authDataCh)

ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
ctx1, cancel1 := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel1()

m, err := mmaker()
if err != nil {
Expand All @@ -57,7 +57,7 @@ func makeOIDCCmd(mmaker manipcli.ManipulatorMaker, restrictions *permissions.Res

client := authlib.NewClient(m)
url, err := client.AuthFromOIDCStep1(
ctx,
ctx1,
fSourceNamespace,
fSourceName,
"http://localhost:65333",
Expand All @@ -71,8 +71,11 @@ func makeOIDCCmd(mmaker manipcli.ManipulatorMaker, restrictions *permissions.Res
authD := <-authDataCh
srvCancel()

ctx2, cancel2 := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel2()

t, err := client.AuthFromOIDCStep2(
ctx,
ctx2,
fSourceNamespace,
fSourceName,
authD.code,
Expand Down

0 comments on commit 7ca9245

Please sign in to comment.