Skip to content

Commit

Permalink
fix: Changes OIDC to use static URL in Redirect_URI (#144)
Browse files Browse the repository at this point in the history
* fix: Changes OIDC auth to use static URI in redirect URI

---------

Co-authored-by: François Michel <[email protected]>
  • Loading branch information
EthanHeilman and francoismichel authored Jul 30, 2024
1 parent 3b9d74d commit 64b140f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions auth/openid_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package auth
import (
"context"
"crypto/rand"
"encoding/hex"
"fmt"
"net"
"net/http"
Expand Down Expand Up @@ -37,20 +36,12 @@ func Connect(ctx context.Context, oidcConfig *OIDCConfig, issuerURL string, doPK

providerEndpoint := provider.Endpoint()

randomSecretUrlBytes := [64]byte{}
_, err = rand.Read(randomSecretUrlBytes[:])
if err != nil {
return "", err
}

randomSecretUrl := hex.EncodeToString(randomSecretUrlBytes[:])

listener, err := net.Listen("tcp", ":0")
if err != nil {
panic(err)
}

path := fmt.Sprintf("/ssh/%s", randomSecretUrl)
path := "/ssh"
listeningPort := listener.Addr().(*net.TCPAddr).Port

secretUrl := fmt.Sprintf("http://localhost:%d%s", listeningPort, path)
Expand Down

0 comments on commit 64b140f

Please sign in to comment.