mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-10 18:23:44 +08:00
Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
729c20393c | |||
a90b27b74a | |||
5707e38912 | |||
ed959bd8c7 | |||
b6cdc46023 | |||
c661a57cb2 | |||
8456b7f7c4 | |||
e8d2906e3c | |||
1edb91b3a3 | |||
94b6eb803d | |||
cfce5289ed | |||
10f1c37730 | |||
6035b98653 | |||
e158b58ffa | |||
a399184cfc | |||
2f9f946c87 | |||
d8b60f838e | |||
7599e2715a | |||
35676455bc | |||
8128671c8c | |||
ee54dec3b3 | |||
d278bc9651 | |||
b23bd0b189 | |||
409be85264 | |||
0395b7e1a9 | |||
4536fd0636 |
@ -15,6 +15,8 @@
|
|||||||
package authz
|
package authz
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/casbin/casbin/v2"
|
"github.com/casbin/casbin/v2"
|
||||||
"github.com/casbin/casbin/v2/model"
|
"github.com/casbin/casbin/v2/model"
|
||||||
xormadapter "github.com/casbin/xorm-adapter/v2"
|
xormadapter "github.com/casbin/xorm-adapter/v2"
|
||||||
@ -28,7 +30,7 @@ func InitAuthz() {
|
|||||||
var err error
|
var err error
|
||||||
|
|
||||||
tableNamePrefix := conf.GetConfigString("tableNamePrefix")
|
tableNamePrefix := conf.GetConfigString("tableNamePrefix")
|
||||||
a, err := xormadapter.NewAdapterWithTableName(conf.GetConfigString("driverName"), conf.GetBeegoConfDataSourceName()+conf.GetConfigString("dbName"), "casbin_rule", tableNamePrefix, true)
|
a, err := xormadapter.NewAdapterWithTableName(conf.GetConfigString("driverName"), conf.GetConfigDataSourceName()+conf.GetConfigString("dbName"), "casbin_rule", tableNamePrefix, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -108,6 +110,7 @@ p, *, *, GET, /api/saml/metadata, *, *
|
|||||||
p, *, *, *, /cas, *, *
|
p, *, *, *, /cas, *, *
|
||||||
p, *, *, *, /api/webauthn, *, *
|
p, *, *, *, /api/webauthn, *, *
|
||||||
p, *, *, GET, /api/get-release, *, *
|
p, *, *, GET, /api/get-release, *, *
|
||||||
|
p, *, *, GET, /api/get-default-application, *, *
|
||||||
`
|
`
|
||||||
|
|
||||||
sa := stringadapter.NewAdapter(ruleText)
|
sa := stringadapter.NewAdapter(ruleText)
|
||||||
@ -128,6 +131,12 @@ p, *, *, GET, /api/get-release, *, *
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsAllowed(subOwner string, subName string, method string, urlPath string, objOwner string, objName string) bool {
|
func IsAllowed(subOwner string, subName string, method string, urlPath string, objOwner string, objName string) bool {
|
||||||
|
if conf.IsDemoMode() {
|
||||||
|
if !isAllowedInDemoMode(subOwner, subName, method, urlPath, objOwner, objName) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res, err := Enforcer.Enforce(subOwner, subName, method, urlPath, objOwner, objName)
|
res, err := Enforcer.Enforce(subOwner, subName, method, urlPath, objOwner, objName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@ -135,3 +144,22 @@ func IsAllowed(subOwner string, subName string, method string, urlPath string, o
|
|||||||
|
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isAllowedInDemoMode(subOwner string, subName string, method string, urlPath string, objOwner string, objName string) bool {
|
||||||
|
if method == "POST" {
|
||||||
|
if strings.HasPrefix(urlPath, "/api/login") || urlPath == "/api/logout" || urlPath == "/api/signup" || urlPath == "/api/send-verification-code" {
|
||||||
|
return true
|
||||||
|
} else if urlPath == "/api/update-user" {
|
||||||
|
// Allow ordinary users to update their own information
|
||||||
|
if subOwner == objOwner && subName == objName && !(subOwner == "built-in" && subName == "admin") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If method equals GET
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
4
build.sh
4
build.sh
@ -6,6 +6,6 @@ then
|
|||||||
echo "Successfully connected to Google, no need to use Go proxy"
|
echo "Successfully connected to Google, no need to use Go proxy"
|
||||||
else
|
else
|
||||||
echo "Google is blocked, Go proxy is enabled: GOPROXY=https://goproxy.cn,direct"
|
echo "Google is blocked, Go proxy is enabled: GOPROXY=https://goproxy.cn,direct"
|
||||||
GO_PROXY_SETTING=$(GOPROXY=https://goproxy.cn,direct)
|
export GOPROXY="https://goproxy.cn,direct"
|
||||||
fi
|
fi
|
||||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $GO_PROXY_SETTING go build -ldflags="-w -s" -o server .
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o server .
|
||||||
|
@ -16,4 +16,6 @@ verificationCodeTimeout = 10
|
|||||||
initScore = 2000
|
initScore = 2000
|
||||||
logPostOnly = true
|
logPostOnly = true
|
||||||
origin =
|
origin =
|
||||||
staticBaseUrl = "https://cdn.casbin.org"
|
staticBaseUrl = "https://cdn.casbin.org"
|
||||||
|
isDemoMode = false
|
||||||
|
batchSize = 100
|
||||||
|
37
conf/conf.go
37
conf/conf.go
@ -24,6 +24,19 @@ import (
|
|||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// this array contains the beego configuration items that may be modified via env
|
||||||
|
presetConfigItems := []string{"httpport", "appname"}
|
||||||
|
for _, key := range presetConfigItems {
|
||||||
|
if value, ok := os.LookupEnv(key); ok {
|
||||||
|
err := beego.AppConfig.Set(key, value)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func GetConfigString(key string) string {
|
func GetConfigString(key string) string {
|
||||||
if value, ok := os.LookupEnv(key); ok {
|
if value, ok := os.LookupEnv(key); ok {
|
||||||
return value
|
return value
|
||||||
@ -55,17 +68,7 @@ func GetConfigInt64(key string) (int64, error) {
|
|||||||
return num, err
|
return num, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func GetConfigDataSourceName() string {
|
||||||
// this array contains the beego configuration items that may be modified via env
|
|
||||||
presetConfigItems := []string{"httpport", "appname"}
|
|
||||||
for _, key := range presetConfigItems {
|
|
||||||
if value, ok := os.LookupEnv(key); ok {
|
|
||||||
beego.AppConfig.Set(key, value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetBeegoConfDataSourceName() string {
|
|
||||||
dataSourceName := GetConfigString("dataSourceName")
|
dataSourceName := GetConfigString("dataSourceName")
|
||||||
|
|
||||||
runningInDocker := os.Getenv("RUNNING_IN_DOCKER")
|
runningInDocker := os.Getenv("RUNNING_IN_DOCKER")
|
||||||
@ -80,3 +83,15 @@ func GetBeegoConfDataSourceName() string {
|
|||||||
|
|
||||||
return dataSourceName
|
return dataSourceName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsDemoMode() bool {
|
||||||
|
return strings.ToLower(GetConfigString("isDemoMode")) == "true"
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetConfigBatchSize() int {
|
||||||
|
res, err := strconv.Atoi(GetConfigString("batchSize"))
|
||||||
|
if err != nil {
|
||||||
|
res = 100
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
@ -121,3 +121,23 @@ func (c *ApiController) DeleteOrganization() {
|
|||||||
c.Data["json"] = wrapActionResponse(object.DeleteOrganization(&organization))
|
c.Data["json"] = wrapActionResponse(object.DeleteOrganization(&organization))
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDefaultApplication ...
|
||||||
|
// @Title GetDefaultApplication
|
||||||
|
// @Tag Organization API
|
||||||
|
// @Description get default application
|
||||||
|
// @Param id query string true "organization id"
|
||||||
|
// @Success 200 {object} Response The Response object
|
||||||
|
// @router /get-default-application [get]
|
||||||
|
func (c *ApiController) GetDefaultApplication() {
|
||||||
|
userId := c.GetSessionUsername()
|
||||||
|
id := c.Input().Get("id")
|
||||||
|
|
||||||
|
application := object.GetMaskedApplication(object.GetDefaultApplication(id), userId)
|
||||||
|
if application == nil {
|
||||||
|
c.ResponseError("Please set a default application for this organization")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
c.ResponseOk(application)
|
||||||
|
}
|
||||||
|
@ -121,6 +121,7 @@ func (idp *DingTalkIdProvider) GetToken(code string) (*oauth2.Token, error) {
|
|||||||
type DingTalkUserResponse struct {
|
type DingTalkUserResponse struct {
|
||||||
Nick string `json:"nick"`
|
Nick string `json:"nick"`
|
||||||
OpenId string `json:"openId"`
|
OpenId string `json:"openId"`
|
||||||
|
UnionId string `json:"unionId"`
|
||||||
AvatarUrl string `json:"avatarUrl"`
|
AvatarUrl string `json:"avatarUrl"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
Errmsg string `json:"message"`
|
Errmsg string `json:"message"`
|
||||||
@ -162,6 +163,7 @@ func (idp *DingTalkIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, erro
|
|||||||
Id: dtUserInfo.OpenId,
|
Id: dtUserInfo.OpenId,
|
||||||
Username: dtUserInfo.Nick,
|
Username: dtUserInfo.Nick,
|
||||||
DisplayName: dtUserInfo.Nick,
|
DisplayName: dtUserInfo.Nick,
|
||||||
|
UnionId: dtUserInfo.UnionId,
|
||||||
Email: dtUserInfo.Email,
|
Email: dtUserInfo.Email,
|
||||||
AvatarUrl: dtUserInfo.AvatarUrl,
|
AvatarUrl: dtUserInfo.AvatarUrl,
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ type UserInfo struct {
|
|||||||
Id string
|
Id string
|
||||||
Username string
|
Username string
|
||||||
DisplayName string
|
DisplayName string
|
||||||
|
UnionId string
|
||||||
Email string
|
Email string
|
||||||
AvatarUrl string
|
AvatarUrl string
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ func InitConfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func InitAdapter(createDatabase bool) {
|
func InitAdapter(createDatabase bool) {
|
||||||
adapter = NewAdapter(conf.GetConfigString("driverName"), conf.GetBeegoConfDataSourceName(), conf.GetConfigString("dbName"))
|
adapter = NewAdapter(conf.GetConfigString("driverName"), conf.GetConfigDataSourceName(), conf.GetConfigString("dbName"))
|
||||||
if createDatabase {
|
if createDatabase {
|
||||||
adapter.CreateDatabase()
|
adapter.CreateDatabase()
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ package object
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/casdoor/casdoor/util"
|
"github.com/casdoor/casdoor/util"
|
||||||
@ -66,6 +67,9 @@ type Application struct {
|
|||||||
TermsOfUse string `xorm:"varchar(100)" json:"termsOfUse"`
|
TermsOfUse string `xorm:"varchar(100)" json:"termsOfUse"`
|
||||||
SignupHtml string `xorm:"mediumtext" json:"signupHtml"`
|
SignupHtml string `xorm:"mediumtext" json:"signupHtml"`
|
||||||
SigninHtml string `xorm:"mediumtext" json:"signinHtml"`
|
SigninHtml string `xorm:"mediumtext" json:"signinHtml"`
|
||||||
|
FormCss string `xorm:"text" json:"formCss"`
|
||||||
|
FormOffset int `json:"formOffset"`
|
||||||
|
FormBackgroundUrl string `xorm:"varchar(200)" json:"formBackgroundUrl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetApplicationCount(owner, field, value string) int {
|
func GetApplicationCount(owner, field, value string) int {
|
||||||
@ -319,7 +323,8 @@ func (application *Application) GetId() string {
|
|||||||
func CheckRedirectUriValid(application *Application, redirectUri string) bool {
|
func CheckRedirectUriValid(application *Application, redirectUri string) bool {
|
||||||
validUri := false
|
validUri := false
|
||||||
for _, tmpUri := range application.RedirectUris {
|
for _, tmpUri := range application.RedirectUris {
|
||||||
if strings.Contains(redirectUri, tmpUri) {
|
tmpUriRegex := regexp.MustCompile(tmpUri)
|
||||||
|
if tmpUriRegex.MatchString(redirectUri) || strings.Contains(redirectUri, tmpUri) {
|
||||||
validUri = true
|
validUri = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -16,10 +16,28 @@
|
|||||||
|
|
||||||
package object
|
package object
|
||||||
|
|
||||||
import "github.com/go-gomail/gomail"
|
import (
|
||||||
|
"crypto/tls"
|
||||||
|
|
||||||
|
"github.com/go-gomail/gomail"
|
||||||
|
)
|
||||||
|
|
||||||
|
func getDialer(provider *Provider) *gomail.Dialer {
|
||||||
|
dialer := &gomail.Dialer{}
|
||||||
|
if provider.Type == "SUBMAIL" {
|
||||||
|
dialer = gomail.NewDialer(provider.Host, provider.Port, provider.AppId, provider.ClientSecret)
|
||||||
|
dialer.TLSConfig = &tls.Config{InsecureSkipVerify: true}
|
||||||
|
} else {
|
||||||
|
dialer = gomail.NewDialer(provider.Host, provider.Port, provider.ClientId, provider.ClientSecret)
|
||||||
|
}
|
||||||
|
|
||||||
|
dialer.SSL = !provider.DisableSsl
|
||||||
|
|
||||||
|
return dialer
|
||||||
|
}
|
||||||
|
|
||||||
func SendEmail(provider *Provider, title string, content string, dest string, sender string) error {
|
func SendEmail(provider *Provider, title string, content string, dest string, sender string) error {
|
||||||
dialer := gomail.NewDialer(provider.Host, provider.Port, provider.ClientId, provider.ClientSecret)
|
dialer := getDialer(provider)
|
||||||
|
|
||||||
message := gomail.NewMessage()
|
message := gomail.NewMessage()
|
||||||
message.SetAddressHeader("From", provider.ClientId, sender)
|
message.SetAddressHeader("From", provider.ClientId, sender)
|
||||||
@ -32,8 +50,7 @@ func SendEmail(provider *Provider, title string, content string, dest string, se
|
|||||||
|
|
||||||
// DailSmtpServer Dail Smtp server
|
// DailSmtpServer Dail Smtp server
|
||||||
func DailSmtpServer(provider *Provider) error {
|
func DailSmtpServer(provider *Provider) error {
|
||||||
dialer := gomail.NewDialer(provider.Host, provider.Port, provider.ClientId, provider.ClientSecret)
|
dialer := getDialer(provider)
|
||||||
dialer.SSL = !provider.DisableSsl
|
|
||||||
|
|
||||||
sender, err := dialer.Dial()
|
sender, err := dialer.Dial()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -25,6 +25,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func InitDb() {
|
func InitDb() {
|
||||||
|
MigratePermissionRule()
|
||||||
|
|
||||||
existed := initBuiltInOrganization()
|
existed := initBuiltInOrganization()
|
||||||
if !existed {
|
if !existed {
|
||||||
initBuiltInModel()
|
initBuiltInModel()
|
||||||
@ -155,6 +157,7 @@ func initBuiltInApplication() {
|
|||||||
},
|
},
|
||||||
RedirectUris: []string{},
|
RedirectUris: []string{},
|
||||||
ExpireInHours: 168,
|
ExpireInHours: 168,
|
||||||
|
FormOffset: 8,
|
||||||
}
|
}
|
||||||
AddApplication(application)
|
AddApplication(application)
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,11 @@ type OidcDiscovery struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getOriginFromHost(host string) (string, string) {
|
func getOriginFromHost(host string) (string, string) {
|
||||||
|
origin := conf.GetConfigString("origin")
|
||||||
|
if origin != "" {
|
||||||
|
return origin, origin
|
||||||
|
}
|
||||||
|
|
||||||
protocol := "https://"
|
protocol := "https://"
|
||||||
if strings.HasPrefix(host, "localhost") {
|
if strings.HasPrefix(host, "localhost") {
|
||||||
protocol = "http://"
|
protocol = "http://"
|
||||||
@ -58,12 +63,6 @@ func getOriginFromHost(host string) (string, string) {
|
|||||||
func GetOidcDiscovery(host string) OidcDiscovery {
|
func GetOidcDiscovery(host string) OidcDiscovery {
|
||||||
originFrontend, originBackend := getOriginFromHost(host)
|
originFrontend, originBackend := getOriginFromHost(host)
|
||||||
|
|
||||||
origin := conf.GetConfigString("origin")
|
|
||||||
if origin != "" {
|
|
||||||
originFrontend = origin
|
|
||||||
originBackend = origin
|
|
||||||
}
|
|
||||||
|
|
||||||
// Examples:
|
// Examples:
|
||||||
// https://login.okta.com/.well-known/openid-configuration
|
// https://login.okta.com/.well-known/openid-configuration
|
||||||
// https://auth0.auth0.com/.well-known/openid-configuration
|
// https://auth0.auth0.com/.well-known/openid-configuration
|
||||||
|
@ -41,6 +41,7 @@ type Organization struct {
|
|||||||
PasswordSalt string `xorm:"varchar(100)" json:"passwordSalt"`
|
PasswordSalt string `xorm:"varchar(100)" json:"passwordSalt"`
|
||||||
PhonePrefix string `xorm:"varchar(10)" json:"phonePrefix"`
|
PhonePrefix string `xorm:"varchar(10)" json:"phonePrefix"`
|
||||||
DefaultAvatar string `xorm:"varchar(100)" json:"defaultAvatar"`
|
DefaultAvatar string `xorm:"varchar(100)" json:"defaultAvatar"`
|
||||||
|
DefaultApplication string `xorm:"varchar(100)" json:"defaultApplication"`
|
||||||
Tags []string `xorm:"mediumtext" json:"tags"`
|
Tags []string `xorm:"mediumtext" json:"tags"`
|
||||||
MasterPassword string `xorm:"varchar(100)" json:"masterPassword"`
|
MasterPassword string `xorm:"varchar(100)" json:"masterPassword"`
|
||||||
EnableSoftDeletion bool `json:"enableSoftDeletion"`
|
EnableSoftDeletion bool `json:"enableSoftDeletion"`
|
||||||
@ -216,3 +217,37 @@ func CheckAccountItemModifyRule(accountItem *AccountItem, user *User) (bool, str
|
|||||||
}
|
}
|
||||||
return true, ""
|
return true, ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetDefaultApplication(id string) *Application {
|
||||||
|
organization := GetOrganization(id)
|
||||||
|
if organization == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if organization.DefaultApplication != "" {
|
||||||
|
return getApplication("admin", organization.DefaultApplication)
|
||||||
|
}
|
||||||
|
|
||||||
|
applications := []*Application{}
|
||||||
|
err := adapter.Engine.Asc("created_time").Find(&applications, &Application{Organization: organization.Name})
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(applications) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultApplication := applications[0]
|
||||||
|
for _, application := range applications {
|
||||||
|
if application.EnableSignUp {
|
||||||
|
defaultApplication = application
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extendApplicationWithProviders(defaultApplication)
|
||||||
|
extendApplicationWithOrg(defaultApplication)
|
||||||
|
|
||||||
|
return defaultApplication
|
||||||
|
}
|
||||||
|
@ -16,6 +16,7 @@ package object
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/casdoor/casdoor/util"
|
"github.com/casdoor/casdoor/util"
|
||||||
"xorm.io/core"
|
"xorm.io/core"
|
||||||
@ -208,6 +209,33 @@ func GetPermissionsBySubmitter(owner string, submitter string) []*Permission {
|
|||||||
return permissions
|
return permissions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func MigratePermissionRule() {
|
||||||
|
models := []*Model{}
|
||||||
|
err := adapter.Engine.Find(&models, &Model{})
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
isHit := false
|
||||||
|
for _, model := range models {
|
||||||
|
if strings.Contains(model.ModelText, "permission") {
|
||||||
|
// update model table
|
||||||
|
model.ModelText = strings.Replace(model.ModelText, "permission,", "", -1)
|
||||||
|
UpdateModel(model.GetId(), model)
|
||||||
|
isHit = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if isHit {
|
||||||
|
// update permission_rule table
|
||||||
|
sql := "UPDATE `permission_rule`SET V0 = V1, V1 = V2, V2 = V3, V3 = V4, V4 = V5 WHERE V0 IN (SELECT CONCAT(owner, '/', name) AS permission_id FROM `permission`)"
|
||||||
|
_, err = adapter.Engine.Exec(sql)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func ContainsAsterisk(userId string, users []string) bool {
|
func ContainsAsterisk(userId string, users []string) bool {
|
||||||
containsAsterisk := false
|
containsAsterisk := false
|
||||||
group, _ := util.GetOwnerAndNameFromId(userId)
|
group, _ := util.GetOwnerAndNameFromId(userId)
|
||||||
|
@ -29,7 +29,7 @@ func getEnforcer(permission *Permission) *casbin.Enforcer {
|
|||||||
tableName = permission.Adapter
|
tableName = permission.Adapter
|
||||||
}
|
}
|
||||||
tableNamePrefix := conf.GetConfigString("tableNamePrefix")
|
tableNamePrefix := conf.GetConfigString("tableNamePrefix")
|
||||||
adapter, err := xormadapter.NewAdapterWithTableName(conf.GetConfigString("driverName"), conf.GetBeegoConfDataSourceName()+conf.GetConfigString("dbName"), tableName, tableNamePrefix, true)
|
adapter, err := xormadapter.NewAdapterWithTableName(conf.GetConfigString("driverName"), conf.GetConfigDataSourceName()+conf.GetConfigString("dbName"), tableName, tableNamePrefix, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ type Provider struct {
|
|||||||
DisableSsl bool `json:"disableSsl"`
|
DisableSsl bool `json:"disableSsl"`
|
||||||
Title string `xorm:"varchar(100)" json:"title"`
|
Title string `xorm:"varchar(100)" json:"title"`
|
||||||
Content string `xorm:"varchar(1000)" json:"content"`
|
Content string `xorm:"varchar(1000)" json:"content"`
|
||||||
|
Receiver string `xorm:"varchar(100)" json:"receiver"`
|
||||||
|
|
||||||
RegionId string `xorm:"varchar(100)" json:"regionId"`
|
RegionId string `xorm:"varchar(100)" json:"regionId"`
|
||||||
SignName string `xorm:"varchar(100)" json:"signName"`
|
SignName string `xorm:"varchar(100)" json:"signName"`
|
||||||
|
@ -29,7 +29,6 @@ import (
|
|||||||
|
|
||||||
"github.com/RobotsAndPencils/go-saml"
|
"github.com/RobotsAndPencils/go-saml"
|
||||||
"github.com/beevik/etree"
|
"github.com/beevik/etree"
|
||||||
"github.com/casdoor/casdoor/conf"
|
|
||||||
"github.com/golang-jwt/jwt/v4"
|
"github.com/golang-jwt/jwt/v4"
|
||||||
dsig "github.com/russellhaering/goxmldsig"
|
dsig "github.com/russellhaering/goxmldsig"
|
||||||
uuid "github.com/satori/go.uuid"
|
uuid "github.com/satori/go.uuid"
|
||||||
@ -176,16 +175,12 @@ type Attribute struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetSamlMeta(application *Application, host string) (*IdpEntityDescriptor, error) {
|
func GetSamlMeta(application *Application, host string) (*IdpEntityDescriptor, error) {
|
||||||
//_, originBackend := getOriginFromHost(host)
|
|
||||||
cert := getCertByApplication(application)
|
cert := getCertByApplication(application)
|
||||||
block, _ := pem.Decode([]byte(cert.Certificate))
|
block, _ := pem.Decode([]byte(cert.Certificate))
|
||||||
certificate := base64.StdEncoding.EncodeToString(block.Bytes)
|
certificate := base64.StdEncoding.EncodeToString(block.Bytes)
|
||||||
|
|
||||||
origin := conf.GetConfigString("origin")
|
|
||||||
originFrontend, originBackend := getOriginFromHost(host)
|
originFrontend, originBackend := getOriginFromHost(host)
|
||||||
if origin != "" {
|
|
||||||
originBackend = origin
|
|
||||||
}
|
|
||||||
d := IdpEntityDescriptor{
|
d := IdpEntityDescriptor{
|
||||||
XMLName: xml.Name{
|
XMLName: xml.Name{
|
||||||
Local: "md:EntityDescriptor",
|
Local: "md:EntityDescriptor",
|
||||||
|
@ -70,10 +70,12 @@ func GenerateSamlLoginUrl(id, relayState string) (string, string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func buildSp(provider *Provider, samlResponse string) (*saml2.SAMLServiceProvider, error) {
|
func buildSp(provider *Provider, samlResponse string) (*saml2.SAMLServiceProvider, error) {
|
||||||
|
origin := conf.GetConfigString("origin")
|
||||||
|
|
||||||
certStore := dsig.MemoryX509CertificateStore{
|
certStore := dsig.MemoryX509CertificateStore{
|
||||||
Roots: []*x509.Certificate{},
|
Roots: []*x509.Certificate{},
|
||||||
}
|
}
|
||||||
origin := conf.GetConfigString("origin")
|
|
||||||
certEncodedData := ""
|
certEncodedData := ""
|
||||||
if samlResponse != "" {
|
if samlResponse != "" {
|
||||||
certEncodedData = parseSamlResponse(samlResponse, provider.Type)
|
certEncodedData = parseSamlResponse(samlResponse, provider.Type)
|
||||||
|
@ -18,7 +18,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/casdoor/casdoor/conf"
|
|
||||||
"github.com/casdoor/casdoor/util"
|
"github.com/casdoor/casdoor/util"
|
||||||
"github.com/golang-jwt/jwt/v4"
|
"github.com/golang-jwt/jwt/v4"
|
||||||
)
|
)
|
||||||
@ -67,11 +66,7 @@ func generateJwtToken(application *Application, user *User, nonce string, scope
|
|||||||
refreshExpireTime := nowTime.Add(time.Duration(application.RefreshExpireInHours) * time.Hour)
|
refreshExpireTime := nowTime.Add(time.Duration(application.RefreshExpireInHours) * time.Hour)
|
||||||
|
|
||||||
user.Password = ""
|
user.Password = ""
|
||||||
origin := conf.GetConfigString("origin")
|
|
||||||
_, originBackend := getOriginFromHost(host)
|
_, originBackend := getOriginFromHost(host)
|
||||||
if origin != "" {
|
|
||||||
originBackend = origin
|
|
||||||
}
|
|
||||||
|
|
||||||
name := util.GenerateId()
|
name := util.GenerateId()
|
||||||
jti := fmt.Sprintf("%s/%s", application.Owner, name)
|
jti := fmt.Sprintf("%s/%s", application.Owner, name)
|
||||||
|
@ -488,7 +488,7 @@ func AddUsers(users []*User) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func AddUsersInBatch(users []*User) bool {
|
func AddUsersInBatch(users []*User) bool {
|
||||||
batchSize := 1000
|
batchSize := conf.GetConfigBatchSize()
|
||||||
|
|
||||||
if len(users) == 0 {
|
if len(users) == 0 {
|
||||||
return false
|
return false
|
||||||
@ -527,11 +527,8 @@ func GetUserInfo(userId string, scope string, aud string, host string) (*Userinf
|
|||||||
if user == nil {
|
if user == nil {
|
||||||
return nil, fmt.Errorf("the user: %s doesn't exist", userId)
|
return nil, fmt.Errorf("the user: %s doesn't exist", userId)
|
||||||
}
|
}
|
||||||
origin := conf.GetConfigString("origin")
|
|
||||||
_, originBackend := getOriginFromHost(host)
|
_, originBackend := getOriginFromHost(host)
|
||||||
if origin != "" {
|
|
||||||
originBackend = origin
|
|
||||||
}
|
|
||||||
|
|
||||||
resp := Userinfo{
|
resp := Userinfo{
|
||||||
Sub: user.Id,
|
Sub: user.Id,
|
||||||
|
@ -80,7 +80,7 @@ func SetUserField(user *User, field string, value string) bool {
|
|||||||
value = user.Password
|
value = user.Password
|
||||||
}
|
}
|
||||||
|
|
||||||
affected, err := adapter.Engine.Table(user).ID(core.PK{user.Owner, user.Name}).Update(map[string]interface{}{field: value})
|
affected, err := adapter.Engine.Table(user).ID(core.PK{user.Owner, user.Name}).Update(map[string]interface{}{strings.ToLower(field): value})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -137,6 +137,12 @@ func SetUserOAuthProperties(organization *Organization, user *User, providerType
|
|||||||
user.Email = userInfo.Email
|
user.Email = userInfo.Email
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if userInfo.UnionId != "" {
|
||||||
|
propertyName := fmt.Sprintf("oauth_%s_unionId", providerType)
|
||||||
|
setUserProperty(user, propertyName, userInfo.UnionId)
|
||||||
|
}
|
||||||
|
|
||||||
if userInfo.AvatarUrl != "" {
|
if userInfo.AvatarUrl != "" {
|
||||||
propertyName := fmt.Sprintf("oauth_%s_avatarUrl", providerType)
|
propertyName := fmt.Sprintf("oauth_%s_avatarUrl", providerType)
|
||||||
setUserProperty(user, propertyName, userInfo.AvatarUrl)
|
setUserProperty(user, propertyName, userInfo.AvatarUrl)
|
||||||
|
@ -27,12 +27,9 @@ import (
|
|||||||
func GetWebAuthnObject(host string) *webauthn.WebAuthn {
|
func GetWebAuthnObject(host string) *webauthn.WebAuthn {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
origin := conf.GetConfigString("origin")
|
_, originBackend := getOriginFromHost(host)
|
||||||
if origin == "" {
|
|
||||||
_, origin = getOriginFromHost(host)
|
|
||||||
}
|
|
||||||
|
|
||||||
localUrl, err := url.Parse(origin)
|
localUrl, err := url.Parse(originBackend)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("error when parsing origin:" + err.Error())
|
panic("error when parsing origin:" + err.Error())
|
||||||
}
|
}
|
||||||
@ -40,7 +37,7 @@ func GetWebAuthnObject(host string) *webauthn.WebAuthn {
|
|||||||
webAuthn, err := webauthn.New(&webauthn.Config{
|
webAuthn, err := webauthn.New(&webauthn.Config{
|
||||||
RPDisplayName: conf.GetConfigString("appname"), // Display Name for your site
|
RPDisplayName: conf.GetConfigString("appname"), // Display Name for your site
|
||||||
RPID: strings.Split(localUrl.Host, ":")[0], // Generally the domain name for your site, it's ok because splits cannot return empty array
|
RPID: strings.Split(localUrl.Host, ":")[0], // Generally the domain name for your site, it's ok because splits cannot return empty array
|
||||||
RPOrigin: origin, // The origin URL for WebAuthn requests
|
RPOrigin: originBackend, // The origin URL for WebAuthn requests
|
||||||
// RPIcon: "https://duo.com/logo.png", // Optional icon URL for your site
|
// RPIcon: "https://duo.com/logo.png", // Optional icon URL for your site
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -47,7 +47,7 @@ func SendVerificationCodeToEmail(organization *Organization, user *User, provide
|
|||||||
|
|
||||||
sender := organization.DisplayName
|
sender := organization.DisplayName
|
||||||
title := provider.Title
|
title := provider.Title
|
||||||
code := getRandomCode(5)
|
code := getRandomCode(6)
|
||||||
// "You have requested a verification code at Casdoor. Here is your code: %s, please enter in 5 minutes."
|
// "You have requested a verification code at Casdoor. Here is your code: %s, please enter in 5 minutes."
|
||||||
content := fmt.Sprintf(provider.Content, code)
|
content := fmt.Sprintf(provider.Content, code)
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ func SendVerificationCodeToPhone(organization *Organization, user *User, provide
|
|||||||
return errors.New("please set a SMS provider first")
|
return errors.New("please set a SMS provider first")
|
||||||
}
|
}
|
||||||
|
|
||||||
code := getRandomCode(5)
|
code := getRandomCode(6)
|
||||||
if err := SendSms(provider, code, dest); err != nil {
|
if err := SendSms(provider, code, dest); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -60,6 +60,7 @@ func initAPI() {
|
|||||||
beego.Router("/api/update-organization", &controllers.ApiController{}, "POST:UpdateOrganization")
|
beego.Router("/api/update-organization", &controllers.ApiController{}, "POST:UpdateOrganization")
|
||||||
beego.Router("/api/add-organization", &controllers.ApiController{}, "POST:AddOrganization")
|
beego.Router("/api/add-organization", &controllers.ApiController{}, "POST:AddOrganization")
|
||||||
beego.Router("/api/delete-organization", &controllers.ApiController{}, "POST:DeleteOrganization")
|
beego.Router("/api/delete-organization", &controllers.ApiController{}, "POST:DeleteOrganization")
|
||||||
|
beego.Router("/api/get-default-application", &controllers.ApiController{}, "GET:GetDefaultApplication")
|
||||||
|
|
||||||
beego.Router("/api/get-global-users", &controllers.ApiController{}, "GET:GetGlobalUsers")
|
beego.Router("/api/get-global-users", &controllers.ApiController{}, "GET:GetGlobalUsers")
|
||||||
beego.Router("/api/get-users", &controllers.ApiController{}, "GET:GetUsers")
|
beego.Router("/api/get-users", &controllers.ApiController{}, "GET:GetUsers")
|
||||||
|
@ -97,6 +97,7 @@
|
|||||||
"react/jsx-key": "error",
|
"react/jsx-key": "error",
|
||||||
"no-console": "error",
|
"no-console": "error",
|
||||||
"eqeqeq": "error",
|
"eqeqeq": "error",
|
||||||
|
"keyword-spacing": "error",
|
||||||
|
|
||||||
"react/prop-types": "off",
|
"react/prop-types": "off",
|
||||||
"react/display-name": "off",
|
"react/display-name": "off",
|
||||||
|
@ -388,16 +388,15 @@ class App extends Component {
|
|||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
);
|
);
|
||||||
|
res.push(
|
||||||
|
<Menu.Item key="/permissions">
|
||||||
|
<Link to="/permissions">
|
||||||
|
{i18next.t("general:Permissions")}
|
||||||
|
</Link>
|
||||||
|
</Menu.Item>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
res.push(
|
|
||||||
<Menu.Item key="/permissions">
|
|
||||||
<Link to="/permissions">
|
|
||||||
{i18next.t("general:Permissions")}
|
|
||||||
</Link>
|
|
||||||
</Menu.Item>
|
|
||||||
);
|
|
||||||
|
|
||||||
if (Setting.isAdminUser(this.state.account)) {
|
if (Setting.isAdminUser(this.state.account)) {
|
||||||
res.push(
|
res.push(
|
||||||
<Menu.Item key="/models">
|
<Menu.Item key="/models">
|
||||||
@ -527,7 +526,7 @@ class App extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderRouter() {
|
renderRouter() {
|
||||||
return(
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path="/result" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...props} />)} />
|
<Route exact path="/result" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...props} />)} />
|
||||||
@ -618,7 +617,7 @@ class App extends Component {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return(
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Header style={{padding: "0", marginBottom: "3px"}}>
|
<Header style={{padding: "0", marginBottom: "3px"}}>
|
||||||
{
|
{
|
||||||
@ -746,6 +745,7 @@ class App extends Component {
|
|||||||
const organization = this.state.account.organization;
|
const organization = this.state.account.organization;
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
<div style={{display: "none"}} id="CasdoorApplicationName" value={this.state.account.signupApplication} />
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>{organization.displayName}</title>
|
<title>{organization.displayName}</title>
|
||||||
<link rel="icon" href={organization.favicon} />
|
<link rel="icon" href={organization.favicon} />
|
||||||
|
@ -76,3 +76,8 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loginBackground {
|
||||||
|
background: #ffffff no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {Button, Card, Col, Input, Popover, Row, Select, Switch, Upload} from "antd";
|
import {Button, Card, Col, Input, Popover, Radio, Row, Select, Switch, Upload} from "antd";
|
||||||
import {CopyOutlined, LinkOutlined, UploadOutlined} from "@ant-design/icons";
|
import {CopyOutlined, LinkOutlined, UploadOutlined} from "@ant-design/icons";
|
||||||
import * as ApplicationBackend from "./backend/ApplicationBackend";
|
import * as ApplicationBackend from "./backend/ApplicationBackend";
|
||||||
import * as CertBackend from "./backend/CertBackend";
|
import * as CertBackend from "./backend/CertBackend";
|
||||||
@ -35,9 +35,18 @@ import "codemirror/lib/codemirror.css";
|
|||||||
require("codemirror/theme/material-darker.css");
|
require("codemirror/theme/material-darker.css");
|
||||||
require("codemirror/mode/htmlmixed/htmlmixed");
|
require("codemirror/mode/htmlmixed/htmlmixed");
|
||||||
require("codemirror/mode/xml/xml");
|
require("codemirror/mode/xml/xml");
|
||||||
|
require("codemirror/mode/css/css");
|
||||||
|
|
||||||
const {Option} = Select;
|
const {Option} = Select;
|
||||||
|
|
||||||
|
const template = {
|
||||||
|
padding: "30px",
|
||||||
|
border: "2px solid #ffffff",
|
||||||
|
borderRadius: "7px",
|
||||||
|
backgroundColor: "#ffffff",
|
||||||
|
boxShadow: " 0px 0px 20px rgba(0, 0, 0, 0.20)",
|
||||||
|
};
|
||||||
|
|
||||||
class ApplicationEditPage extends React.Component {
|
class ApplicationEditPage extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
@ -111,7 +120,7 @@ class ApplicationEditPage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parseApplicationField(key, value) {
|
parseApplicationField(key, value) {
|
||||||
if (["expireInHours", "refreshExpireInHours"].includes(key)) {
|
if (["expireInHours", "refreshExpireInHours", "offset"].includes(key)) {
|
||||||
value = Setting.myParseInt(value);
|
value = Setting.myParseInt(value);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
@ -148,6 +157,7 @@ class ApplicationEditPage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderApplication() {
|
renderApplication() {
|
||||||
|
const preview = JSON.stringify(template, null, 2);
|
||||||
return (
|
return (
|
||||||
<Card size="small" title={
|
<Card size="small" title={
|
||||||
<div>
|
<div>
|
||||||
@ -536,6 +546,66 @@ class ApplicationEditPage extends React.Component {
|
|||||||
this.renderSignupSigninPreview()
|
this.renderSignupSigninPreview()
|
||||||
}
|
}
|
||||||
</Row>
|
</Row>
|
||||||
|
<Row style={{marginTop: "20px"}} >
|
||||||
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
|
{Setting.getLabel(i18next.t("application:Background URL"), i18next.t("application:Background URL - Tooltip"))} :
|
||||||
|
</Col>
|
||||||
|
<Col span={22} style={(Setting.isMobile()) ? {maxWidth: "100%"} : {}}>
|
||||||
|
<Row style={{marginTop: "20px"}} >
|
||||||
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 1}>
|
||||||
|
{Setting.getLabel(i18next.t("general:URL"), i18next.t("general:URL - Tooltip"))} :
|
||||||
|
</Col>
|
||||||
|
<Col span={23} >
|
||||||
|
<Input prefix={<LinkOutlined />} value={this.state.application.formBackgroundUrl} onChange={e => {
|
||||||
|
this.updateApplicationField("formBackgroundUrl", e.target.value);
|
||||||
|
}} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row style={{marginTop: "20px"}} >
|
||||||
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
|
{i18next.t("general:Preview")}:
|
||||||
|
</Col>
|
||||||
|
<Col span={22} >
|
||||||
|
<a target="_blank" rel="noreferrer" href={this.state.application.formBackgroundUrl}>
|
||||||
|
<img src={this.state.application.formBackgroundUrl} alt={this.state.application.formBackgroundUrl} height={90} style={{marginBottom: "20px"}} />
|
||||||
|
</a>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
|
{Setting.getLabel(i18next.t("application:Form CSS"), i18next.t("application:Form CSS - Tooltip"))} :
|
||||||
|
</Col>
|
||||||
|
<Col span={22}>
|
||||||
|
<Popover placement="right" content={
|
||||||
|
<div style={{width: "900px", height: "300px"}} >
|
||||||
|
<CodeMirror value={this.state.application.formCss === "" ? preview : this.state.application.formCss}
|
||||||
|
options={{mode: "css", theme: "material-darker"}}
|
||||||
|
onBeforeChange={(editor, data, value) => {
|
||||||
|
this.updateApplicationField("formCss", value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
} title={i18next.t("application:Form CSS - Edit")} trigger="click">
|
||||||
|
<Input value={this.state.application.formCss} style={{marginBottom: "10px"}} onChange={e => {
|
||||||
|
this.updateApplicationField("formCss", e.target.value);
|
||||||
|
}} />
|
||||||
|
</Popover>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row style={{marginTop: "20px"}} >
|
||||||
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
|
{Setting.getLabel(i18next.t("application:From position"), i18next.t("application:From position - Tooltip"))} :
|
||||||
|
</Col>
|
||||||
|
<Col span={22} >
|
||||||
|
<Radio.Group onChange={e => {this.updateApplicationField("formOffset", e.target.value);}} value={this.state.application.formOffset !== 0 ? this.state.application.formOffset : 8}>
|
||||||
|
<Radio.Button value={2}>left</Radio.Button>
|
||||||
|
<Radio.Button value={8}>center</Radio.Button>
|
||||||
|
<Radio.Button value={14}>right</Radio.Button>
|
||||||
|
</Radio.Group>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
{
|
{
|
||||||
!this.state.application.enableSignUp ? null : (
|
!this.state.application.enableSignUp ? null : (
|
||||||
<Row style={{marginTop: "20px"}} >
|
<Row style={{marginTop: "20px"}} >
|
||||||
@ -591,7 +661,7 @@ class ApplicationEditPage extends React.Component {
|
|||||||
<LoginPage type={"login"} mode={"signup"} application={this.state.application} />
|
<LoginPage type={"login"} mode={"signup"} application={this.state.application} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<div style={maskStyle}></div>
|
<div style={maskStyle} />
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={11}>
|
<Col span={11}>
|
||||||
@ -605,7 +675,7 @@ class ApplicationEditPage extends React.Component {
|
|||||||
<br />
|
<br />
|
||||||
<div style={{position: "relative", width: "90%", border: "1px solid rgb(217,217,217)", boxShadow: "10px 10px 5px #888888", alignItems: "center", overflow: "auto", flexDirection: "column", flex: "auto"}}>
|
<div style={{position: "relative", width: "90%", border: "1px solid rgb(217,217,217)", boxShadow: "10px 10px 5px #888888", alignItems: "center", overflow: "auto", flexDirection: "column", flex: "auto"}}>
|
||||||
<LoginPage type={"login"} mode={"signin"} application={this.state.application} />
|
<LoginPage type={"login"} mode={"signin"} application={this.state.application} />
|
||||||
<div style={maskStyle}></div>
|
<div style={maskStyle} />
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
@ -53,6 +53,7 @@ class ApplicationListPage extends BaseListPage {
|
|||||||
redirectUris: ["http://localhost:9000/callback"],
|
redirectUris: ["http://localhost:9000/callback"],
|
||||||
tokenFormat: "JWT",
|
tokenFormat: "JWT",
|
||||||
expireInHours: 24 * 7,
|
expireInHours: 24 * 7,
|
||||||
|
formOffset: 8,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class ModelListPage extends BaseListPage {
|
|||||||
...this.getColumnSearchProps("name"),
|
...this.getColumnSearchProps("name"),
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
return (
|
return (
|
||||||
<Link to={`/models/${text}`}>
|
<Link to={`/models/${record.owner}/${text}`}>
|
||||||
{text}
|
{text}
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import {Button, Card, Col, Input, Row, Select, Switch} from "antd";
|
import {Button, Card, Col, Input, Row, Select, Switch} from "antd";
|
||||||
import * as OrganizationBackend from "./backend/OrganizationBackend";
|
import * as OrganizationBackend from "./backend/OrganizationBackend";
|
||||||
|
import * as ApplicationBackend from "./backend/ApplicationBackend";
|
||||||
import * as LdapBackend from "./backend/LdapBackend";
|
import * as LdapBackend from "./backend/LdapBackend";
|
||||||
import * as Setting from "./Setting";
|
import * as Setting from "./Setting";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
@ -31,6 +32,7 @@ class OrganizationEditPage extends React.Component {
|
|||||||
classes: props,
|
classes: props,
|
||||||
organizationName: props.match.params.organizationName,
|
organizationName: props.match.params.organizationName,
|
||||||
organization: null,
|
organization: null,
|
||||||
|
applications: [],
|
||||||
ldaps: null,
|
ldaps: null,
|
||||||
mode: props.location.mode !== undefined ? props.location.mode : "edit",
|
mode: props.location.mode !== undefined ? props.location.mode : "edit",
|
||||||
};
|
};
|
||||||
@ -38,6 +40,7 @@ class OrganizationEditPage extends React.Component {
|
|||||||
|
|
||||||
UNSAFE_componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getOrganization();
|
this.getOrganization();
|
||||||
|
this.getApplications();
|
||||||
this.getLdaps();
|
this.getLdaps();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,6 +53,15 @@ class OrganizationEditPage extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getApplications() {
|
||||||
|
ApplicationBackend.getApplicationsByOrganization("admin", this.state.organizationName)
|
||||||
|
.then((applications) => {
|
||||||
|
this.setState({
|
||||||
|
applications: applications,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getLdaps() {
|
getLdaps() {
|
||||||
LdapBackend.getLdaps(this.state.organizationName)
|
LdapBackend.getLdaps(this.state.organizationName)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
@ -209,6 +221,18 @@ class OrganizationEditPage extends React.Component {
|
|||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<Row style={{marginTop: "20px"}} >
|
||||||
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
|
{Setting.getLabel(i18next.t("general:Default application"), i18next.t("general:Default application - Tooltip"))} :
|
||||||
|
</Col>
|
||||||
|
<Col span={22} >
|
||||||
|
<Select virtual={false} style={{width: "100%"}} value={this.state.organization.defaultApplication} onChange={(value => {this.updateOrganizationField("defaultApplication", value);})}>
|
||||||
|
{
|
||||||
|
this.state.applications?.map((item, index) => <Option key={index} value={item.name}>{item.name}</Option>)
|
||||||
|
}
|
||||||
|
</Select>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
<Row style={{marginTop: "20px"}} >
|
<Row style={{marginTop: "20px"}} >
|
||||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
{Setting.getLabel(i18next.t("organization:Tags"), i18next.t("organization:Tags - Tooltip"))} :
|
{Setting.getLabel(i18next.t("organization:Tags"), i18next.t("organization:Tags - Tooltip"))} :
|
||||||
|
@ -35,6 +35,7 @@ class OrganizationListPage extends BaseListPage {
|
|||||||
PasswordSalt: "",
|
PasswordSalt: "",
|
||||||
phonePrefix: "86",
|
phonePrefix: "86",
|
||||||
defaultAvatar: `${Setting.StaticBaseUrl}/img/casbin.svg`,
|
defaultAvatar: `${Setting.StaticBaseUrl}/img/casbin.svg`,
|
||||||
|
defaultApplication: "",
|
||||||
tags: [],
|
tags: [],
|
||||||
masterPassword: "",
|
masterPassword: "",
|
||||||
enableSoftDeletion: false,
|
enableSoftDeletion: false,
|
||||||
|
@ -34,7 +34,6 @@ class ProviderEditPage extends React.Component {
|
|||||||
providerName: props.match.params.providerName,
|
providerName: props.match.params.providerName,
|
||||||
provider: null,
|
provider: null,
|
||||||
mode: props.location.mode !== undefined ? props.location.mode : "edit",
|
mode: props.location.mode !== undefined ? props.location.mode : "edit",
|
||||||
testEmail: this.props.account["email"] !== undefined ? this.props.account["email"] : "",
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,6 +130,9 @@ class ProviderEditPage extends React.Component {
|
|||||||
} else if (this.state.provider.category === "SMS" && this.state.provider.type === "Huawei Cloud SMS") {
|
} else if (this.state.provider.category === "SMS" && this.state.provider.type === "Huawei Cloud SMS") {
|
||||||
text = i18next.t("provider:Channel No.");
|
text = i18next.t("provider:Channel No.");
|
||||||
tooltip = i18next.t("provider:Channel No. - Tooltip");
|
tooltip = i18next.t("provider:Channel No. - Tooltip");
|
||||||
|
} else if (this.state.provider.category === "Email" && this.state.provider.type === "SUBMAIL") {
|
||||||
|
text = i18next.t("provider:App ID");
|
||||||
|
tooltip = i18next.t("provider:App ID - Tooltip");
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -199,9 +201,12 @@ class ProviderEditPage extends React.Component {
|
|||||||
this.updateProviderField("type", "GitHub");
|
this.updateProviderField("type", "GitHub");
|
||||||
} else if (value === "Email") {
|
} else if (value === "Email") {
|
||||||
this.updateProviderField("type", "Default");
|
this.updateProviderField("type", "Default");
|
||||||
|
this.updateProviderField("host", "smtp.example.com");
|
||||||
|
this.updateProviderField("port", 465);
|
||||||
this.updateProviderField("disableSsl", false);
|
this.updateProviderField("disableSsl", false);
|
||||||
this.updateProviderField("title", "Casdoor Verification Code");
|
this.updateProviderField("title", "Casdoor Verification Code");
|
||||||
this.updateProviderField("content", "You have requested a verification code at Casdoor. Here is your code: %s, please enter in 5 minutes.");
|
this.updateProviderField("content", "You have requested a verification code at Casdoor. Here is your code: %s, please enter in 5 minutes.");
|
||||||
|
this.updateProviderField("receiver", this.props.account.email);
|
||||||
} else if (value === "SMS") {
|
} else if (value === "SMS") {
|
||||||
this.updateProviderField("type", "Aliyun SMS");
|
this.updateProviderField("type", "Aliyun SMS");
|
||||||
} else if (value === "Storage") {
|
} else if (value === "Storage") {
|
||||||
@ -536,7 +541,7 @@ class ProviderEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("provider:Email Content"), i18next.t("provider:Email Content - Tooltip"))} :
|
{Setting.getLabel(i18next.t("provider:Email Content"), i18next.t("provider:Email Content - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<TextArea autoSize={{minRows: 1, maxRows: 100}} value={this.state.provider.content} onChange={e => {
|
<TextArea autoSize={{minRows: 3, maxRows: 100}} value={this.state.provider.content} onChange={e => {
|
||||||
this.updateProviderField("content", e.target.value);
|
this.updateProviderField("content", e.target.value);
|
||||||
}} />
|
}} />
|
||||||
</Col>
|
</Col>
|
||||||
@ -546,19 +551,16 @@ class ProviderEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("provider:Test Email"), i18next.t("provider:Test Email - Tooltip"))} :
|
{Setting.getLabel(i18next.t("provider:Test Email"), i18next.t("provider:Test Email - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={4} >
|
<Col span={4} >
|
||||||
<Input value={this.state.testEmail}
|
<Input value={this.state.provider.receiver} placeholder = {i18next.t("user:Input your email")} onChange={e => {
|
||||||
placeHolder = {i18next.t("user:Input your email")}
|
this.updateProviderField("receiver", e.target.value);
|
||||||
onChange={e => {
|
}} />
|
||||||
this.setState({testEmail: e.target.value});
|
|
||||||
}} />
|
|
||||||
</Col>
|
</Col>
|
||||||
<Button style={{marginLeft: "10px", marginBottom: "5px"}} type="primary"
|
<Button style={{marginLeft: "10px", marginBottom: "5px"}} type="primary" onClick={() => ProviderEditTestEmail.connectSmtpServer(this.state.provider)} >
|
||||||
onClick={() => ProviderEditTestEmail.connectSmtpServer(this.state.provider)} >
|
|
||||||
{i18next.t("provider:Test Connection")}
|
{i18next.t("provider:Test Connection")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button style={{marginLeft: "10px", marginBottom: "5px"}} type="primary"
|
<Button style={{marginLeft: "10px", marginBottom: "5px"}} type="primary"
|
||||||
disabled={!Setting.isValidEmail(this.state.testEmail)}
|
disabled={!Setting.isValidEmail(this.state.provider.receiver)}
|
||||||
onClick={() => ProviderEditTestEmail.sendTestEmail(this.state.provider, this.state.testEmail)} >
|
onClick={() => ProviderEditTestEmail.sendTestEmail(this.state.provider, this.state.provider.receiver)} >
|
||||||
{i18next.t("provider:Send Test Email")}
|
{i18next.t("provider:Send Test Email")}
|
||||||
</Button>
|
</Button>
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -56,8 +56,12 @@ export const ResetModal = (props) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
let placeHolder = "";
|
let placeholder = "";
|
||||||
if (destType === "email") {placeHolder = i18next.t("user:Input your email");} else if (destType === "phone") {placeHolder = i18next.t("user:Input your phone number");}
|
if (destType === "email") {
|
||||||
|
placeholder = i18next.t("user:Input your email");
|
||||||
|
} else if (destType === "phone") {
|
||||||
|
placeholder = i18next.t("user:Input your phone number");
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row>
|
<Row>
|
||||||
@ -80,7 +84,7 @@ export const ResetModal = (props) => {
|
|||||||
<Input
|
<Input
|
||||||
addonBefore={destType === "email" ? i18next.t("user:New Email") : i18next.t("user:New phone")}
|
addonBefore={destType === "email" ? i18next.t("user:New Email") : i18next.t("user:New phone")}
|
||||||
prefix={destType === "email" ? <MailOutlined /> : <PhoneOutlined />}
|
prefix={destType === "email" ? <MailOutlined /> : <PhoneOutlined />}
|
||||||
placeholder={placeHolder}
|
placeholder={placeholder}
|
||||||
onChange={e => setDest(e.target.value)}
|
onChange={e => setDest(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -82,7 +82,7 @@ export const OtherProviderInfo = {
|
|||||||
url: "https://cloud.tencent.com/product/cos",
|
url: "https://cloud.tencent.com/product/cos",
|
||||||
},
|
},
|
||||||
"Azure Blob": {
|
"Azure Blob": {
|
||||||
logo: `${StaticBaseUrl}/img/social_azure.jpg`,
|
logo: `${StaticBaseUrl}/img/social_azure.png`,
|
||||||
url: "https://azure.microsoft.com/en-us/services/storage/blobs/",
|
url: "https://azure.microsoft.com/en-us/services/storage/blobs/",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -354,6 +354,14 @@ export function isPromptAnswered(user, application) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function parseObject(s) {
|
||||||
|
try {
|
||||||
|
return eval("(" + s + ")");
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function parseJson(s) {
|
export function parseJson(s) {
|
||||||
if (s === "") {
|
if (s === "") {
|
||||||
return null;
|
return null;
|
||||||
@ -450,9 +458,9 @@ export function trim(str, ch) {
|
|||||||
let start = 0;
|
let start = 0;
|
||||||
let end = str.length;
|
let end = str.length;
|
||||||
|
|
||||||
while(start < end && str[start] === ch) {++start;}
|
while (start < end && str[start] === ch) {++start;}
|
||||||
|
|
||||||
while(end > start && str[end - 1] === ch) {--end;}
|
while (end > start && str[end - 1] === ch) {--end;}
|
||||||
|
|
||||||
return (start > 0 || end < str.length) ? str.substring(start, end) : str;
|
return (start > 0 || end < str.length) ? str.substring(start, end) : str;
|
||||||
}
|
}
|
||||||
@ -500,7 +508,7 @@ export function getFriendlyFileSize(size) {
|
|||||||
return `${num} ${"KMGTPEZY"[i - 1]}B`;
|
return `${num} ${"KMGTPEZY"[i - 1]}B`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandomInt(s) {
|
function getHashInt(s) {
|
||||||
let hash = 0;
|
let hash = 0;
|
||||||
if (s.length !== 0) {
|
if (s.length !== 0) {
|
||||||
for (let i = 0; i < s.length; i++) {
|
for (let i = 0; i < s.length; i++) {
|
||||||
@ -510,16 +518,16 @@ function getRandomInt(s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hash < 0) {
|
||||||
|
hash = -hash;
|
||||||
|
}
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAvatarColor(s) {
|
export function getAvatarColor(s) {
|
||||||
const colorList = ["#f56a00", "#7265e6", "#ffbf00", "#00a2ae"];
|
const colorList = ["#f56a00", "#7265e6", "#ffbf00", "#00a2ae"];
|
||||||
let random = getRandomInt(s);
|
const hash = getHashInt(s);
|
||||||
if (random < 0) {
|
return colorList[hash % 4];
|
||||||
random = -random;
|
|
||||||
}
|
|
||||||
return colorList[random % 4];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLanguage() {
|
export function getLanguage() {
|
||||||
@ -633,6 +641,7 @@ export function getProviderTypeOptions(category) {
|
|||||||
return (
|
return (
|
||||||
[
|
[
|
||||||
{id: "Default", name: "Default"},
|
{id: "Default", name: "Default"},
|
||||||
|
{id: "SUBMAIL", name: "SUBMAIL"},
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
} else if (category === "SMS") {
|
} else if (category === "SMS") {
|
||||||
@ -706,12 +715,12 @@ export function renderLogo(application) {
|
|||||||
if (application.homepageUrl !== "") {
|
if (application.homepageUrl !== "") {
|
||||||
return (
|
return (
|
||||||
<a target="_blank" rel="noreferrer" href={application.homepageUrl}>
|
<a target="_blank" rel="noreferrer" href={application.homepageUrl}>
|
||||||
<img width={250} src={application.logo} alt={application.displayName} style={{marginBottom: "30px"}} />
|
<img width={250} src={application.logo} alt={application.displayName} style={{marginBottom: "10px"}} />
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<img width={250} src={application.logo} alt={application.displayName} style={{marginBottom: "30px"}} />
|
<img width={250} src={application.logo} alt={application.displayName} style={{marginBottom: "10px"}} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -912,6 +921,14 @@ export function scrollToDiv(divId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function inIframe() {
|
||||||
|
try {
|
||||||
|
return window !== window.parent;
|
||||||
|
} catch (e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function getSyncerTableColumns(syncer) {
|
export function getSyncerTableColumns(syncer) {
|
||||||
switch (syncer.type) {
|
switch (syncer.type) {
|
||||||
case "Keycloak":
|
case "Keycloak":
|
||||||
|
@ -499,7 +499,7 @@ class UserEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("user:Is admin"), i18next.t("user:Is admin - Tooltip"))} :
|
{Setting.getLabel(i18next.t("user:Is admin"), i18next.t("user:Is admin - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={(Setting.isMobile()) ? 22 : 2} >
|
<Col span={(Setting.isMobile()) ? 22 : 2} >
|
||||||
<Switch checked={this.state.user.isAdmin} onChange={checked => {
|
<Switch disabled={this.state.user.owner === "built-in"} checked={this.state.user.isAdmin} onChange={checked => {
|
||||||
this.updateUserField("isAdmin", checked);
|
this.updateUserField("isAdmin", checked);
|
||||||
}} />
|
}} />
|
||||||
</Col>
|
</Col>
|
||||||
@ -512,7 +512,7 @@ class UserEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("user:Is global admin"), i18next.t("user:Is global admin - Tooltip"))} :
|
{Setting.getLabel(i18next.t("user:Is global admin"), i18next.t("user:Is global admin - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={(Setting.isMobile()) ? 22 : 2} >
|
<Col span={(Setting.isMobile()) ? 22 : 2} >
|
||||||
<Switch checked={this.state.user.isGlobalAdmin} onChange={checked => {
|
<Switch disabled={this.state.user.owner === "built-in"} checked={this.state.user.isGlobalAdmin} onChange={checked => {
|
||||||
this.updateUserField("isGlobalAdmin", checked);
|
this.updateUserField("isGlobalAdmin", checked);
|
||||||
}} />
|
}} />
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -41,8 +41,9 @@ class UserListPage extends BaseListPage {
|
|||||||
|
|
||||||
newUser() {
|
newUser() {
|
||||||
const randomName = Setting.getRandomName();
|
const randomName = Setting.getRandomName();
|
||||||
|
const owner = (this.state.organizationName !== undefined) ? this.state.organizationName : this.props.account.owner;
|
||||||
return {
|
return {
|
||||||
owner: "built-in", // this.props.account.username,
|
owner: owner,
|
||||||
name: `user_${randomName}`,
|
name: `user_${randomName}`,
|
||||||
createdTime: moment().format(),
|
createdTime: moment().format(),
|
||||||
type: "normal-user",
|
type: "normal-user",
|
||||||
@ -56,8 +57,8 @@ class UserListPage extends BaseListPage {
|
|||||||
affiliation: "Example Inc.",
|
affiliation: "Example Inc.",
|
||||||
tag: "staff",
|
tag: "staff",
|
||||||
region: "",
|
region: "",
|
||||||
isAdmin: false,
|
isAdmin: (owner === "built-in"),
|
||||||
isGlobalAdmin: false,
|
isGlobalAdmin: (owner === "built-in"),
|
||||||
IsForbidden: false,
|
IsForbidden: false,
|
||||||
isDeleted: false,
|
isDeleted: false,
|
||||||
properties: {},
|
properties: {},
|
||||||
@ -326,6 +327,7 @@ class UserListPage extends BaseListPage {
|
|||||||
width: "190px",
|
width: "190px",
|
||||||
fixed: (Setting.isMobile()) ? "false" : "right",
|
fixed: (Setting.isMobile()) ? "false" : "right",
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
|
const disabled = (record.owner === this.props.account.owner && record.name === this.props.account.name);
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Button style={{marginTop: "10px", marginBottom: "10px", marginRight: "10px"}} type="primary" onClick={() => this.props.history.push(`/users/${record.owner}/${record.name}`)}>{i18next.t("general:Edit")}</Button>
|
<Button style={{marginTop: "10px", marginBottom: "10px", marginRight: "10px"}} type="primary" onClick={() => this.props.history.push(`/users/${record.owner}/${record.name}`)}>{i18next.t("general:Edit")}</Button>
|
||||||
@ -333,7 +335,7 @@ class UserListPage extends BaseListPage {
|
|||||||
title={`Sure to delete user: ${record.name} ?`}
|
title={`Sure to delete user: ${record.name} ?`}
|
||||||
onConfirm={() => this.deleteUser(index)}
|
onConfirm={() => this.deleteUser(index)}
|
||||||
>
|
>
|
||||||
<Button style={{marginBottom: "10px"}} type="danger">{i18next.t("general:Delete")}</Button>
|
<Button disabled={disabled} style={{marginBottom: "10px"}} type="danger">{i18next.t("general:Delete")}</Button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -35,7 +35,7 @@ class AuthCallback extends React.Component {
|
|||||||
// realRedirectUrl = "http://localhost:9000"
|
// realRedirectUrl = "http://localhost:9000"
|
||||||
const params = new URLSearchParams(this.props.location.search);
|
const params = new URLSearchParams(this.props.location.search);
|
||||||
const state = params.get("state");
|
const state = params.get("state");
|
||||||
const queryString = Util.stateToGetQueryParams(state);
|
const queryString = Util.getQueryParamsFromState(state);
|
||||||
return new URLSearchParams(queryString);
|
return new URLSearchParams(queryString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,8 +50,12 @@ class AuthCallback extends React.Component {
|
|||||||
// Casdoor's own login page, so "code" is not necessary
|
// Casdoor's own login page, so "code" is not necessary
|
||||||
if (realRedirectUri === null) {
|
if (realRedirectUri === null) {
|
||||||
const samlRequest = innerParams.get("SAMLRequest");
|
const samlRequest = innerParams.get("SAMLRequest");
|
||||||
|
// cas don't use 'redirect_url', it is called 'service'
|
||||||
|
const casService = innerParams.get("service");
|
||||||
if (samlRequest !== null && samlRequest !== undefined && samlRequest !== "") {
|
if (samlRequest !== null && samlRequest !== undefined && samlRequest !== "") {
|
||||||
return "saml";
|
return "saml";
|
||||||
|
} else if (casService !== null && casService !== undefined && casService !== "") {
|
||||||
|
return "cas";
|
||||||
}
|
}
|
||||||
return "login";
|
return "login";
|
||||||
}
|
}
|
||||||
@ -97,6 +101,7 @@ class AuthCallback extends React.Component {
|
|||||||
const providerName = innerParams.get("provider");
|
const providerName = innerParams.get("provider");
|
||||||
const method = innerParams.get("method");
|
const method = innerParams.get("method");
|
||||||
const samlRequest = innerParams.get("SAMLRequest");
|
const samlRequest = innerParams.get("SAMLRequest");
|
||||||
|
const casService = innerParams.get("service");
|
||||||
|
|
||||||
const redirectUri = `${window.location.origin}/callback`;
|
const redirectUri = `${window.location.origin}/callback`;
|
||||||
|
|
||||||
@ -111,6 +116,31 @@ class AuthCallback extends React.Component {
|
|||||||
redirectUri: redirectUri,
|
redirectUri: redirectUri,
|
||||||
method: method,
|
method: method,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (this.getResponseType() === "cas") {
|
||||||
|
// user is using casdoor as cas sso server, and wants the ticket to be acquired
|
||||||
|
AuthBackend.loginCas(body, {"service": casService}).then((res) => {
|
||||||
|
if (res.status === "ok") {
|
||||||
|
let msg = "Logged in successfully.";
|
||||||
|
if (casService === "") {
|
||||||
|
// If service was not specified, Casdoor must display a message notifying the client that it has successfully initiated a single sign-on session.
|
||||||
|
msg += "Now you can visit apps protected by Casdoor.";
|
||||||
|
}
|
||||||
|
Util.showMessage("success", msg);
|
||||||
|
|
||||||
|
if (casService !== "") {
|
||||||
|
const st = res.data;
|
||||||
|
const newUrl = new URL(casService);
|
||||||
|
newUrl.searchParams.append("ticket", st);
|
||||||
|
window.location.href = newUrl.toString();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Util.showMessage("error", `Failed to log in: ${res.msg}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// OAuth
|
||||||
const oAuthParams = Util.getOAuthGetParameters(innerParams);
|
const oAuthParams = Util.getOAuthGetParameters(innerParams);
|
||||||
const concatChar = oAuthParams?.redirectUri?.includes("?") ? "&" : "?";
|
const concatChar = oAuthParams?.redirectUri?.includes("?") ? "&" : "?";
|
||||||
AuthBackend.login(body, oAuthParams)
|
AuthBackend.login(body, oAuthParams)
|
||||||
|
@ -18,6 +18,7 @@ import {Button, Checkbox, Col, Form, Input, Result, Row, Spin, Tabs} from "antd"
|
|||||||
import {LockOutlined, UserOutlined} from "@ant-design/icons";
|
import {LockOutlined, UserOutlined} from "@ant-design/icons";
|
||||||
import * as UserWebauthnBackend from "../backend/UserWebauthnBackend";
|
import * as UserWebauthnBackend from "../backend/UserWebauthnBackend";
|
||||||
import * as AuthBackend from "./AuthBackend";
|
import * as AuthBackend from "./AuthBackend";
|
||||||
|
import * as OrganizationBackend from "../backend/OrganizationBackend";
|
||||||
import * as ApplicationBackend from "../backend/ApplicationBackend";
|
import * as ApplicationBackend from "../backend/ApplicationBackend";
|
||||||
import * as Provider from "./Provider";
|
import * as Provider from "./Provider";
|
||||||
import * as ProviderButton from "./ProviderButton";
|
import * as ProviderButton from "./ProviderButton";
|
||||||
@ -90,12 +91,26 @@ class LoginPage extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationBackend.getApplication("admin", this.state.applicationName)
|
if (this.state.owner === null || this.state.owner === undefined || this.state.owner === "") {
|
||||||
.then((application) => {
|
ApplicationBackend.getApplication("admin", this.state.applicationName)
|
||||||
this.setState({
|
.then((application) => {
|
||||||
application: application,
|
this.setState({
|
||||||
|
application: application,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
} else {
|
||||||
|
OrganizationBackend.getDefaultApplication("admin", this.state.owner)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.status === "ok") {
|
||||||
|
this.setState({
|
||||||
|
application: res.data,
|
||||||
|
applicationName: res.data.name,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Util.showMessage("error", res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getSamlApplication() {
|
getSamlApplication() {
|
||||||
@ -334,49 +349,54 @@ class LoginPage extends React.Component {
|
|||||||
>
|
>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{this.renderMethodChoiceBox()}
|
{this.renderMethodChoiceBox()}
|
||||||
<Form.Item
|
<Row style={{minHeight: 130, alignItems: "center"}}>
|
||||||
name="username"
|
<Col span={24}>
|
||||||
rules={[
|
<Form.Item
|
||||||
{
|
name="username"
|
||||||
required: true,
|
rules={[
|
||||||
message: i18next.t("login:Please input your username, Email or phone!"),
|
{
|
||||||
},
|
required: true,
|
||||||
{
|
message: i18next.t("login:Please input your username, Email or phone!"),
|
||||||
validator: (_, value) => {
|
},
|
||||||
if (this.state.isCodeSignin) {
|
{
|
||||||
if (this.state.email !== "" && !Setting.isValidEmail(this.state.username) && !Setting.isValidPhone(this.state.username)) {
|
validator: (_, value) => {
|
||||||
this.setState({validEmailOrPhone: false});
|
if (this.state.isCodeSignin) {
|
||||||
return Promise.reject(i18next.t("login:The input is not valid Email or Phone!"));
|
if (this.state.email !== "" && !Setting.isValidEmail(this.state.username) && !Setting.isValidPhone(this.state.username)) {
|
||||||
}
|
this.setState({validEmailOrPhone: false});
|
||||||
|
return Promise.reject(i18next.t("login:The input is not valid Email or Phone!"));
|
||||||
|
}
|
||||||
|
|
||||||
if (Setting.isValidPhone(this.state.username)) {
|
if (Setting.isValidPhone(this.state.username)) {
|
||||||
this.setState({validPhone: true});
|
this.setState({validPhone: true});
|
||||||
}
|
}
|
||||||
if (Setting.isValidEmail(this.state.username)) {
|
if (Setting.isValidEmail(this.state.username)) {
|
||||||
this.setState({validEmail: true});
|
this.setState({validEmail: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({validEmailOrPhone: true});
|
this.setState({validEmailOrPhone: true});
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
prefix={<UserOutlined className="site-form-item-icon" />}
|
id = "input"
|
||||||
placeholder={this.state.isCodeSignin ? i18next.t("login:Email or phone") : i18next.t("login:username, Email or phone")}
|
prefix={<UserOutlined className="site-form-item-icon" />}
|
||||||
disabled={!application.enablePassword}
|
placeholder={this.state.isCodeSignin ? i18next.t("login:Email or phone") : i18next.t("login:username, Email or phone")}
|
||||||
onChange={e => {
|
disabled={!application.enablePassword}
|
||||||
this.setState({
|
onChange={e => {
|
||||||
username: e.target.value,
|
this.setState({
|
||||||
});
|
username: e.target.value,
|
||||||
}}
|
});
|
||||||
/>
|
}}
|
||||||
</Form.Item>
|
/>
|
||||||
{
|
</Form.Item>
|
||||||
this.renderPasswordOrCodeInput()
|
</Col>
|
||||||
}
|
{
|
||||||
|
this.renderPasswordOrCodeInput()
|
||||||
|
}
|
||||||
|
</Row>
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
<Form.Item name="autoSignin" valuePropName="checked" noStyle>
|
<Form.Item name="autoSignin" valuePropName="checked" noStyle>
|
||||||
<Checkbox style={{float: "left"}} disabled={!application.enablePassword}>
|
<Checkbox style={{float: "left"}} disabled={!application.enablePassword}>
|
||||||
@ -618,28 +638,32 @@ class LoginPage extends React.Component {
|
|||||||
const application = this.getApplicationObj();
|
const application = this.getApplicationObj();
|
||||||
if (this.state.loginMethod === "password") {
|
if (this.state.loginMethod === "password") {
|
||||||
return this.state.isCodeSignin ? (
|
return this.state.isCodeSignin ? (
|
||||||
<Form.Item
|
<Col span={24}>
|
||||||
name="code"
|
<Form.Item
|
||||||
rules={[{required: true, message: i18next.t("login:Please input your code!")}]}
|
name="code"
|
||||||
>
|
rules={[{required: true, message: i18next.t("login:Please input your code!")}]}
|
||||||
<CountDownInput
|
>
|
||||||
disabled={this.state.username?.length === 0 || !this.state.validEmailOrPhone}
|
<CountDownInput
|
||||||
onButtonClickArgs={[this.state.username, this.state.validEmail ? "email" : "phone", Setting.getApplicationName(application)]}
|
disabled={this.state.username?.length === 0 || !this.state.validEmailOrPhone}
|
||||||
application={application}
|
onButtonClickArgs={[this.state.username, this.state.validEmail ? "email" : "phone", Setting.getApplicationName(application)]}
|
||||||
/>
|
application={application}
|
||||||
</Form.Item>
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
) : (
|
) : (
|
||||||
<Form.Item
|
<Col span={24}>
|
||||||
name="password"
|
<Form.Item
|
||||||
rules={[{required: true, message: i18next.t("login:Please input your password!")}]}
|
name="password"
|
||||||
>
|
rules={[{required: true, message: i18next.t("login:Please input your password!")}]}
|
||||||
<Input
|
>
|
||||||
prefix={<LockOutlined className="site-form-item-icon" />}
|
<Input
|
||||||
type="password"
|
prefix={<LockOutlined className="site-form-item-icon" />}
|
||||||
placeholder={i18next.t("login:Password")}
|
type="password"
|
||||||
disabled={!application.enablePassword}
|
placeholder={i18next.t("login:Password")}
|
||||||
/>
|
disabled={!application.enablePassword}
|
||||||
</Form.Item>
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -680,29 +704,36 @@ class LoginPage extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formStyle = Setting.inIframe() ? null : Setting.parseObject(application.formCss);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row>
|
<div className="loginBackground" style={{backgroundImage: Setting.inIframe() ? null : `url(${application.formBackgroundUrl})`}}>
|
||||||
<Col span={24} style={{display: "flex", justifyContent: "center"}}>
|
<CustomGithubCorner />
|
||||||
<div style={{marginTop: "80px", marginBottom: "50px", textAlign: "center"}}>
|
<Row>
|
||||||
{
|
<Col span={8} offset={application.formOffset === 0 || Setting.inIframe() ? 8 : application.formOffset} style={{display: "flex", justifyContent: "center"}}>
|
||||||
Setting.renderHelmet(application)
|
<div style={{marginTop: "80px", marginBottom: "50px", textAlign: "center", ...formStyle}}>
|
||||||
}
|
<div>
|
||||||
<CustomGithubCorner />
|
{
|
||||||
{
|
Setting.renderHelmet(application)
|
||||||
Setting.renderLogo(application)
|
}
|
||||||
}
|
{
|
||||||
{/* {*/}
|
Setting.renderLogo(application)
|
||||||
{/* this.state.clientId !== null ? "Redirect" : null*/}
|
}
|
||||||
{/* }*/}
|
{/* {*/}
|
||||||
{
|
{/* this.state.clientId !== null ? "Redirect" : null*/}
|
||||||
this.renderSignedInBox()
|
{/* }*/}
|
||||||
}
|
{
|
||||||
{
|
this.renderSignedInBox()
|
||||||
this.renderForm(application)
|
}
|
||||||
}
|
{
|
||||||
</div>
|
this.renderForm(application)
|
||||||
</Col>
|
}
|
||||||
</Row>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,9 @@ export function getAuthUrl(application, provider, method) {
|
|||||||
let endpoint = authInfo[provider.type].endpoint;
|
let endpoint = authInfo[provider.type].endpoint;
|
||||||
const redirectUri = `${window.location.origin}/callback`;
|
const redirectUri = `${window.location.origin}/callback`;
|
||||||
const scope = authInfo[provider.type].scope;
|
const scope = authInfo[provider.type].scope;
|
||||||
const state = Util.getQueryParamsToState(application.name, provider.name, method);
|
|
||||||
|
const isShortState = provider.type === "WeChat" && navigator.userAgent.includes("MicroMessenger");
|
||||||
|
const state = Util.getStateFromQueryParams(application.name, provider.name, method, isShortState);
|
||||||
|
|
||||||
if (provider.type === "Google") {
|
if (provider.type === "Google") {
|
||||||
return `${endpoint}?client_id=${provider.clientId}&redirect_uri=${redirectUri}&scope=${scope}&response_type=code&state=${state}`;
|
return `${endpoint}?client_id=${provider.clientId}&redirect_uri=${redirectUri}&scope=${scope}&response_type=code&state=${state}`;
|
||||||
|
@ -584,9 +584,9 @@ class SignupPage extends React.Component {
|
|||||||
{i18next.t("signup:Have account?")}
|
{i18next.t("signup:Have account?")}
|
||||||
<a onClick={() => {
|
<a onClick={() => {
|
||||||
const linkInStorage = sessionStorage.getItem("signinUrl");
|
const linkInStorage = sessionStorage.getItem("signinUrl");
|
||||||
if(linkInStorage !== null && linkInStorage !== "") {
|
if (linkInStorage !== null && linkInStorage !== "") {
|
||||||
Setting.goToLink(linkInStorage);
|
Setting.goToLink(linkInStorage);
|
||||||
}else{
|
} else {
|
||||||
Setting.goToLogin(this, application);
|
Setting.goToLogin(this, application);
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
@ -614,13 +614,15 @@ class SignupPage extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formStyle = Setting.inIframe() ? null : Setting.parseObject(application.formCss);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="loginBackground" style={{backgroundImage: Setting.inIframe() ? null : `url(${application.formBackgroundUrl})`}}>
|
||||||
<CustomGithubCorner />
|
<CustomGithubCorner />
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24} style={{display: "flex", justifyContent: "center"}} >
|
<Col span={8} offset={application.formOffset === 0 || Setting.inIframe() ? 8 : application.formOffset} style={{display: "flex", justifyContent: "center"}} >
|
||||||
<div style={{marginTop: "10px", textAlign: "center"}}>
|
<div style={{marginBottom: "10px", textAlign: "center", ...formStyle}}>
|
||||||
{
|
{
|
||||||
Setting.renderHelmet(application)
|
Setting.renderHelmet(application)
|
||||||
}
|
}
|
||||||
|
@ -126,15 +126,27 @@ export function getOAuthGetParameters(params) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getQueryParamsToState(applicationName, providerName, method) {
|
export function getStateFromQueryParams(applicationName, providerName, method, isShortState) {
|
||||||
let query = window.location.search;
|
let query = window.location.search;
|
||||||
query = `${query}&application=${applicationName}&provider=${providerName}&method=${method}`;
|
query = `${query}&application=${applicationName}&provider=${providerName}&method=${method}`;
|
||||||
if (method === "link") {
|
if (method === "link") {
|
||||||
query = `${query}&from=${window.location.pathname}`;
|
query = `${query}&from=${window.location.pathname}`;
|
||||||
}
|
}
|
||||||
return btoa(query);
|
|
||||||
|
if (!isShortState) {
|
||||||
|
return btoa(query);
|
||||||
|
} else {
|
||||||
|
const state = providerName;
|
||||||
|
sessionStorage.setItem(state, query);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function stateToGetQueryParams(state) {
|
export function getQueryParamsFromState(state) {
|
||||||
return atob(state);
|
const query = sessionStorage.getItem(state);
|
||||||
|
if (query === null) {
|
||||||
|
return atob(state);
|
||||||
|
} else {
|
||||||
|
return query;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,3 +54,10 @@ export function deleteOrganization(organization) {
|
|||||||
body: JSON.stringify(newOrganization),
|
body: JSON.stringify(newOrganization),
|
||||||
}).then(res => res.json());
|
}).then(res => res.json());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getDefaultApplication(owner, name) {
|
||||||
|
return fetch(`${Setting.ServerUrl}/api/get-default-application?id=${owner}/${encodeURIComponent(name)}`, {
|
||||||
|
method: "GET",
|
||||||
|
credentials: "include",
|
||||||
|
}).then(res => res.json());
|
||||||
|
}
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
"Sign Up": "Registrieren"
|
"Sign Up": "Registrieren"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
|
"Background URL": "Background URL",
|
||||||
|
"Background URL - Tooltip": "Background URL - Tooltip",
|
||||||
"Copy SAML metadata URL": "Copy SAML metadata URL",
|
"Copy SAML metadata URL": "Copy SAML metadata URL",
|
||||||
"Copy prompt page URL": "Copy prompt page URL",
|
"Copy prompt page URL": "Copy prompt page URL",
|
||||||
"Copy signin page URL": "Copy signin page URL",
|
"Copy signin page URL": "Copy signin page URL",
|
||||||
@ -21,6 +23,11 @@
|
|||||||
"Enable signup": "Anmeldung aktivieren",
|
"Enable signup": "Anmeldung aktivieren",
|
||||||
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
||||||
"File uploaded successfully": "Datei erfolgreich hochgeladen",
|
"File uploaded successfully": "Datei erfolgreich hochgeladen",
|
||||||
|
"Form CSS": "Form CSS",
|
||||||
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
|
"Form CSS - Tooltip": "Form CSS - Tooltip",
|
||||||
|
"From position": "From position",
|
||||||
|
"From position - Tooltip": "From position - Tooltip",
|
||||||
"Grant types": "Grant types",
|
"Grant types": "Grant types",
|
||||||
"Grant types - Tooltip": "Grant types - Tooltip",
|
"Grant types - Tooltip": "Grant types - Tooltip",
|
||||||
"New Application": "New Application",
|
"New Application": "New Application",
|
||||||
@ -117,6 +124,8 @@
|
|||||||
"Click to Upload": "Click to Upload",
|
"Click to Upload": "Click to Upload",
|
||||||
"Client IP": "Client-IP",
|
"Client IP": "Client-IP",
|
||||||
"Created time": "Erstellte Zeit",
|
"Created time": "Erstellte Zeit",
|
||||||
|
"Default application": "Default application",
|
||||||
|
"Default application - Tooltip": "Default application - Tooltip",
|
||||||
"Default avatar": "Standard Avatar",
|
"Default avatar": "Standard Avatar",
|
||||||
"Default avatar - Tooltip": "default avatar",
|
"Default avatar - Tooltip": "default avatar",
|
||||||
"Delete": "Löschen",
|
"Delete": "Löschen",
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
"Sign Up": "Sign Up"
|
"Sign Up": "Sign Up"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
|
"Background URL": "Background URL",
|
||||||
|
"Background URL - Tooltip": "Background URL - Tooltip",
|
||||||
"Copy SAML metadata URL": "Copy SAML metadata URL",
|
"Copy SAML metadata URL": "Copy SAML metadata URL",
|
||||||
"Copy prompt page URL": "Copy prompt page URL",
|
"Copy prompt page URL": "Copy prompt page URL",
|
||||||
"Copy signin page URL": "Copy signin page URL",
|
"Copy signin page URL": "Copy signin page URL",
|
||||||
@ -21,6 +23,11 @@
|
|||||||
"Enable signup": "Enable signup",
|
"Enable signup": "Enable signup",
|
||||||
"Enable signup - Tooltip": "Enable signup - Tooltip",
|
"Enable signup - Tooltip": "Enable signup - Tooltip",
|
||||||
"File uploaded successfully": "File uploaded successfully",
|
"File uploaded successfully": "File uploaded successfully",
|
||||||
|
"Form CSS": "Form CSS",
|
||||||
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
|
"Form CSS - Tooltip": "Form CSS - Tooltip",
|
||||||
|
"From position": "From position",
|
||||||
|
"From position - Tooltip": "From position - Tooltip",
|
||||||
"Grant types": "Grant types",
|
"Grant types": "Grant types",
|
||||||
"Grant types - Tooltip": "Grant types - Tooltip",
|
"Grant types - Tooltip": "Grant types - Tooltip",
|
||||||
"New Application": "New Application",
|
"New Application": "New Application",
|
||||||
@ -117,6 +124,8 @@
|
|||||||
"Click to Upload": "Click to Upload",
|
"Click to Upload": "Click to Upload",
|
||||||
"Client IP": "Client IP",
|
"Client IP": "Client IP",
|
||||||
"Created time": "Created time",
|
"Created time": "Created time",
|
||||||
|
"Default application": "Default application",
|
||||||
|
"Default application - Tooltip": "Default application - Tooltip",
|
||||||
"Default avatar": "Default avatar",
|
"Default avatar": "Default avatar",
|
||||||
"Default avatar - Tooltip": "Default avatar - Tooltip",
|
"Default avatar - Tooltip": "Default avatar - Tooltip",
|
||||||
"Delete": "Delete",
|
"Delete": "Delete",
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
"Sign Up": "S'inscrire"
|
"Sign Up": "S'inscrire"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
|
"Background URL": "Background URL",
|
||||||
|
"Background URL - Tooltip": "Background URL - Tooltip",
|
||||||
"Copy SAML metadata URL": "Copy SAML metadata URL",
|
"Copy SAML metadata URL": "Copy SAML metadata URL",
|
||||||
"Copy prompt page URL": "Copy prompt page URL",
|
"Copy prompt page URL": "Copy prompt page URL",
|
||||||
"Copy signin page URL": "Copy signin page URL",
|
"Copy signin page URL": "Copy signin page URL",
|
||||||
@ -21,6 +23,11 @@
|
|||||||
"Enable signup": "Activer l'inscription",
|
"Enable signup": "Activer l'inscription",
|
||||||
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
||||||
"File uploaded successfully": "Fichier téléchargé avec succès",
|
"File uploaded successfully": "Fichier téléchargé avec succès",
|
||||||
|
"Form CSS": "Form CSS",
|
||||||
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
|
"Form CSS - Tooltip": "Form CSS - Tooltip",
|
||||||
|
"From position": "From position",
|
||||||
|
"From position - Tooltip": "From position - Tooltip",
|
||||||
"Grant types": "Grant types",
|
"Grant types": "Grant types",
|
||||||
"Grant types - Tooltip": "Grant types - Tooltip",
|
"Grant types - Tooltip": "Grant types - Tooltip",
|
||||||
"New Application": "New Application",
|
"New Application": "New Application",
|
||||||
@ -117,6 +124,8 @@
|
|||||||
"Click to Upload": "Click to Upload",
|
"Click to Upload": "Click to Upload",
|
||||||
"Client IP": "IP du client",
|
"Client IP": "IP du client",
|
||||||
"Created time": "Date de création",
|
"Created time": "Date de création",
|
||||||
|
"Default application": "Default application",
|
||||||
|
"Default application - Tooltip": "Default application - Tooltip",
|
||||||
"Default avatar": "Avatar par défaut",
|
"Default avatar": "Avatar par défaut",
|
||||||
"Default avatar - Tooltip": "default avatar",
|
"Default avatar - Tooltip": "default avatar",
|
||||||
"Delete": "Supprimez",
|
"Delete": "Supprimez",
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
"Sign Up": "新規登録"
|
"Sign Up": "新規登録"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
|
"Background URL": "Background URL",
|
||||||
|
"Background URL - Tooltip": "Background URL - Tooltip",
|
||||||
"Copy SAML metadata URL": "Copy SAML metadata URL",
|
"Copy SAML metadata URL": "Copy SAML metadata URL",
|
||||||
"Copy prompt page URL": "Copy prompt page URL",
|
"Copy prompt page URL": "Copy prompt page URL",
|
||||||
"Copy signin page URL": "Copy signin page URL",
|
"Copy signin page URL": "Copy signin page URL",
|
||||||
@ -21,6 +23,11 @@
|
|||||||
"Enable signup": "サインアップを有効にする",
|
"Enable signup": "サインアップを有効にする",
|
||||||
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
||||||
"File uploaded successfully": "ファイルが正常にアップロードされました",
|
"File uploaded successfully": "ファイルが正常にアップロードされました",
|
||||||
|
"Form CSS": "Form CSS",
|
||||||
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
|
"Form CSS - Tooltip": "Form CSS - Tooltip",
|
||||||
|
"From position": "From position",
|
||||||
|
"From position - Tooltip": "From position - Tooltip",
|
||||||
"Grant types": "Grant types",
|
"Grant types": "Grant types",
|
||||||
"Grant types - Tooltip": "Grant types - Tooltip",
|
"Grant types - Tooltip": "Grant types - Tooltip",
|
||||||
"New Application": "New Application",
|
"New Application": "New Application",
|
||||||
@ -117,6 +124,8 @@
|
|||||||
"Click to Upload": "Click to Upload",
|
"Click to Upload": "Click to Upload",
|
||||||
"Client IP": "クライアント IP",
|
"Client IP": "クライアント IP",
|
||||||
"Created time": "作成日時",
|
"Created time": "作成日時",
|
||||||
|
"Default application": "Default application",
|
||||||
|
"Default application - Tooltip": "Default application - Tooltip",
|
||||||
"Default avatar": "デフォルトのアバター",
|
"Default avatar": "デフォルトのアバター",
|
||||||
"Default avatar - Tooltip": "default avatar",
|
"Default avatar - Tooltip": "default avatar",
|
||||||
"Delete": "削除",
|
"Delete": "削除",
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
"Sign Up": "Sign Up"
|
"Sign Up": "Sign Up"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
|
"Background URL": "Background URL",
|
||||||
|
"Background URL - Tooltip": "Background URL - Tooltip",
|
||||||
"Copy SAML metadata URL": "Copy SAML metadata URL",
|
"Copy SAML metadata URL": "Copy SAML metadata URL",
|
||||||
"Copy prompt page URL": "Copy prompt page URL",
|
"Copy prompt page URL": "Copy prompt page URL",
|
||||||
"Copy signin page URL": "Copy signin page URL",
|
"Copy signin page URL": "Copy signin page URL",
|
||||||
@ -21,6 +23,11 @@
|
|||||||
"Enable signup": "Enable signup",
|
"Enable signup": "Enable signup",
|
||||||
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
||||||
"File uploaded successfully": "File uploaded successfully",
|
"File uploaded successfully": "File uploaded successfully",
|
||||||
|
"Form CSS": "Form CSS",
|
||||||
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
|
"Form CSS - Tooltip": "Form CSS - Tooltip",
|
||||||
|
"From position": "From position",
|
||||||
|
"From position - Tooltip": "From position - Tooltip",
|
||||||
"Grant types": "Grant types",
|
"Grant types": "Grant types",
|
||||||
"Grant types - Tooltip": "Grant types - Tooltip",
|
"Grant types - Tooltip": "Grant types - Tooltip",
|
||||||
"New Application": "New Application",
|
"New Application": "New Application",
|
||||||
@ -117,6 +124,8 @@
|
|||||||
"Click to Upload": "Click to Upload",
|
"Click to Upload": "Click to Upload",
|
||||||
"Client IP": "Client IP",
|
"Client IP": "Client IP",
|
||||||
"Created time": "Created time",
|
"Created time": "Created time",
|
||||||
|
"Default application": "Default application",
|
||||||
|
"Default application - Tooltip": "Default application - Tooltip",
|
||||||
"Default avatar": "Default avatar",
|
"Default avatar": "Default avatar",
|
||||||
"Default avatar - Tooltip": "default avatar",
|
"Default avatar - Tooltip": "default avatar",
|
||||||
"Delete": "Delete",
|
"Delete": "Delete",
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
"Sign Up": "Регистрация"
|
"Sign Up": "Регистрация"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
|
"Background URL": "Background URL",
|
||||||
|
"Background URL - Tooltip": "Background URL - Tooltip",
|
||||||
"Copy SAML metadata URL": "Копировать адрес метаданных SAML",
|
"Copy SAML metadata URL": "Копировать адрес метаданных SAML",
|
||||||
"Copy prompt page URL": "Скопировать URL-адрес страницы запроса",
|
"Copy prompt page URL": "Скопировать URL-адрес страницы запроса",
|
||||||
"Copy signin page URL": "Скопировать URL-адрес страницы входа",
|
"Copy signin page URL": "Скопировать URL-адрес страницы входа",
|
||||||
@ -21,6 +23,11 @@
|
|||||||
"Enable signup": "Включить регистрацию",
|
"Enable signup": "Включить регистрацию",
|
||||||
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
||||||
"File uploaded successfully": "Файл успешно загружен",
|
"File uploaded successfully": "Файл успешно загружен",
|
||||||
|
"Form CSS": "Form CSS",
|
||||||
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
|
"Form CSS - Tooltip": "Form CSS - Tooltip",
|
||||||
|
"From position": "From position",
|
||||||
|
"From position - Tooltip": "From position - Tooltip",
|
||||||
"Grant types": "Виды грантов",
|
"Grant types": "Виды грантов",
|
||||||
"Grant types - Tooltip": "Виды грантов - Подсказка",
|
"Grant types - Tooltip": "Виды грантов - Подсказка",
|
||||||
"New Application": "Новое приложение",
|
"New Application": "Новое приложение",
|
||||||
@ -117,6 +124,8 @@
|
|||||||
"Click to Upload": "Нажмите здесь, чтобы загрузить",
|
"Click to Upload": "Нажмите здесь, чтобы загрузить",
|
||||||
"Client IP": "IP клиента",
|
"Client IP": "IP клиента",
|
||||||
"Created time": "Время создания",
|
"Created time": "Время создания",
|
||||||
|
"Default application": "Default application",
|
||||||
|
"Default application - Tooltip": "Default application - Tooltip",
|
||||||
"Default avatar": "Аватар по умолчанию",
|
"Default avatar": "Аватар по умолчанию",
|
||||||
"Default avatar - Tooltip": "default avatar",
|
"Default avatar - Tooltip": "default avatar",
|
||||||
"Delete": "Удалить",
|
"Delete": "Удалить",
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
"Sign Up": "注册"
|
"Sign Up": "注册"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
|
"Background URL": "背景图URL",
|
||||||
|
"Background URL - Tooltip": "登录页背景图的链接",
|
||||||
"Copy SAML metadata URL": "复制SAML元数据URL",
|
"Copy SAML metadata URL": "复制SAML元数据URL",
|
||||||
"Copy prompt page URL": "复制提醒页面URL",
|
"Copy prompt page URL": "复制提醒页面URL",
|
||||||
"Copy signin page URL": "复制登录页面URL",
|
"Copy signin page URL": "复制登录页面URL",
|
||||||
@ -21,6 +23,11 @@
|
|||||||
"Enable signup": "启用注册",
|
"Enable signup": "启用注册",
|
||||||
"Enable signup - Tooltip": "是否允许用户注册",
|
"Enable signup - Tooltip": "是否允许用户注册",
|
||||||
"File uploaded successfully": "文件上传成功",
|
"File uploaded successfully": "文件上传成功",
|
||||||
|
"Form CSS": "表单CSS",
|
||||||
|
"Form CSS - Edit": "编辑表单CSS",
|
||||||
|
"Form CSS - Tooltip": "表单的CSS样式(增加边框和阴影)",
|
||||||
|
"From position": "面板的位置",
|
||||||
|
"From position - Tooltip": "登录和注册面板的位置",
|
||||||
"Grant types": "OAuth授权类型",
|
"Grant types": "OAuth授权类型",
|
||||||
"Grant types - Tooltip": "选择允许哪些OAuth协议中的Grant types",
|
"Grant types - Tooltip": "选择允许哪些OAuth协议中的Grant types",
|
||||||
"New Application": "添加应用",
|
"New Application": "添加应用",
|
||||||
@ -117,6 +124,8 @@
|
|||||||
"Click to Upload": "点击上传",
|
"Click to Upload": "点击上传",
|
||||||
"Client IP": "客户端IP",
|
"Client IP": "客户端IP",
|
||||||
"Created time": "创建时间",
|
"Created time": "创建时间",
|
||||||
|
"Default application": "默认应用",
|
||||||
|
"Default application - Tooltip": "默认应用",
|
||||||
"Default avatar": "默认头像",
|
"Default avatar": "默认头像",
|
||||||
"Default avatar - Tooltip": "默认头像",
|
"Default avatar - Tooltip": "默认头像",
|
||||||
"Delete": "删除",
|
"Delete": "删除",
|
||||||
|
Reference in New Issue
Block a user