v1 done
This commit is contained in:
parent
f073e69417
commit
0a79763f69
17 changed files with 460 additions and 159 deletions
|
@ -17,6 +17,7 @@ import (
|
|||
var (
|
||||
oidcClientID = ""
|
||||
oidcSecret = ""
|
||||
oidcRedirectURL = "https://srs.nemunai.re"
|
||||
oauth2Config oauth2.Config
|
||||
oidcVerifier *oidc.IDTokenVerifier
|
||||
)
|
||||
|
@ -24,6 +25,7 @@ var (
|
|||
func init() {
|
||||
flag.StringVar(&oidcClientID, "oidc-clientid", oidcClientID, "ClientID for OIDC")
|
||||
flag.StringVar(&oidcSecret, "oidc-secret", oidcSecret, "Secret for OIDC")
|
||||
flag.StringVar(&oidcRedirectURL, "oidc-redirect", oidcRedirectURL, "Base URL for the redirect after connection")
|
||||
|
||||
router.GET("/auth/CRI", redirectOIDC_CRI)
|
||||
router.GET("/auth/complete", OIDC_CRI_complete)
|
||||
|
@ -39,7 +41,7 @@ func initializeOIDC() {
|
|||
oauth2Config = oauth2.Config{
|
||||
ClientID: oidcClientID,
|
||||
ClientSecret: oidcSecret,
|
||||
RedirectURL: "http://localhost:8081" + baseURL + "/auth/complete",
|
||||
RedirectURL: oidcRedirectURL + baseURL + "/auth/complete",
|
||||
|
||||
// Discovery returns the OAuth2 endpoints.
|
||||
Endpoint: provider.Endpoint(),
|
||||
|
|
Reference in a new issue