fix: improvements for login and oidc (#227)

* add csrf

* caching

* caching

* caching

* caching

* security headers

* csp and security headers

* error handler csp

* select user with display name

* csp

* user selection styling

* username to loginname

* regenerate grpc

* regenerate

* change to login name
This commit is contained in:
Livio Amstutz
2020-06-17 08:06:40 +02:00
committed by GitHub
parent dfe6d0deb4
commit 1c59d18fee
108 changed files with 19226 additions and 19220 deletions
@@ -4,10 +4,11 @@ import (
"bytes"
"net/http"
"github.com/aaronarduino/goqrsvg"
svg "github.com/ajstarks/svgo"
"github.com/boombuler/barcode/qr"
"github.com/caos/zitadel/internal/auth_request/model"
"github.com/caos/zitadel/internal/qrcode"
)
const (
@@ -67,7 +68,7 @@ func (l *Login) renderMfaInitVerify(w http.ResponseWriter, r *http.Request, auth
errMessage = l.getErrorMessage(r, err)
}
data.baseData = l.getBaseData(r, authReq, "Mfa Init Verify", errType, errMessage)
data.UserName = authReq.UserName
data.LoginName = authReq.LoginName
if data.MfaType == model.MfaTypeOTP {
code, err := generateQrCode(data.otpData.Url)
if err == nil {
@@ -86,7 +87,7 @@ func generateQrCode(url string) (string, error) {
if err != nil {
return "", err
}
qs := goqrsvg.NewQrSVG(qrCode, 5)
qs := qrcode.NewQrSVG(qrCode, 5)
qs.StartQrSVG(s)
qs.WriteQrSVG(s)