split checker from token-validator
This commit is contained in:
parent
685dc0b0ea
commit
0c661f36f6
20 changed files with 634 additions and 748 deletions
|
|
@ -12,11 +12,13 @@ import (
|
|||
|
||||
"github.com/coreos/go-oidc"
|
||||
"github.com/julienschmidt/httprouter"
|
||||
|
||||
"git.nemunai.re/lectures/adlin/libadlin"
|
||||
)
|
||||
|
||||
var (
|
||||
oidcClientID = ""
|
||||
oidcSecret = ""
|
||||
oidcSecret = ""
|
||||
oauth2Config oauth2.Config
|
||||
oidcVerifier *oidc.IDTokenVerifier
|
||||
)
|
||||
|
|
@ -49,7 +51,7 @@ func initializeOIDC() {
|
|||
}
|
||||
|
||||
oidcConfig := oidc.Config{
|
||||
ClientID: oidcClientID,
|
||||
ClientID: oidcClientID,
|
||||
}
|
||||
oidcVerifier = provider.Verifier(&oidcConfig)
|
||||
}
|
||||
|
|
@ -57,7 +59,7 @@ func initializeOIDC() {
|
|||
}
|
||||
|
||||
func redirectOIDC_CRI(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
session, err := NewSession()
|
||||
session, err := adlin.NewSession()
|
||||
if err != nil {
|
||||
http.Error(w, fmt.Sprintf("{'errmsg':%q}", err.Error()), http.StatusInternalServerError)
|
||||
} else {
|
||||
|
|
@ -72,7 +74,7 @@ func OIDC_CRI_complete(w http.ResponseWriter, r *http.Request, ps httprouter.Par
|
|||
return
|
||||
}
|
||||
|
||||
session, err := getSession(idsession)
|
||||
session, err := adlin.GetSession(idsession)
|
||||
if err != nil {
|
||||
http.Error(w, fmt.Sprintf("{'errmsg':%q}", err.Error()), http.StatusBadRequest)
|
||||
return
|
||||
|
|
|
|||
Reference in a new issue