diff --git a/domain/auth/cas/endpoint.go b/domain/auth/cas/endpoint.go index e6af3134..c1f502b0 100644 --- a/domain/auth/cas/endpoint.go +++ b/domain/auth/cas/endpoint.go @@ -4,6 +4,11 @@ import ( "database/sql" "encoding/json" "fmt" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/documize/community/core/env" "github.com/documize/community/core/response" "github.com/documize/community/core/secrets" @@ -16,10 +21,6 @@ import ( ath "github.com/documize/community/model/auth" "github.com/documize/community/model/user" casv2 "gopkg.in/cas.v2" - "io/ioutil" - "net/http" - "net/url" - "strings" ) // Handler contains the runtime information such as logging and database. @@ -28,7 +29,6 @@ type Handler struct { Store *store.Store } - // Authenticate checks CAS authentication credentials. func (h *Handler) Authenticate(w http.ResponseWriter, r *http.Request) { method := "authenticate" @@ -63,15 +63,15 @@ func (h *Handler) Authenticate(w http.ResponseWriter, r *http.Request) { ac := ath.CASConfig{} err = json.Unmarshal([]byte(org.AuthConfig), &ac) if err != nil { - response.WriteBadRequestError(w, method, "Unable to unmarshall Keycloak Public Key") + response.WriteBadRequestError(w, method, "Unable to unmarshal CAS configuration") h.Runtime.Log.Error(method, err) return } service := url.QueryEscape(ac.RedirectURL) - validateUrl := ac.URL + "/serviceValidate?ticket=" + a.Ticket + "&service="+ service; + validateURL := ac.URL + "/serviceValidate?ticket=" + a.Ticket + "&service=" + service - resp, err := http.Get(validateUrl) + resp, err := http.Get(validateURL) if err != nil { response.WriteBadRequestError(w, method, "Unable to get service validate url") h.Runtime.Log.Error(method, err) diff --git a/gui/app/authenticators/cas.js b/gui/app/authenticators/cas.js index 0518bdb2..a49a6f92 100644 --- a/gui/app/authenticators/cas.js +++ b/gui/app/authenticators/cas.js @@ -10,10 +10,8 @@ // https://documize.com import { isPresent } from '@ember/utils'; - import { reject, resolve } from 'rsvp'; import { inject as service } from '@ember/service'; - import Base from 'ember-simple-auth/authenticators/base'; import netUtil from "../utils/net"; diff --git a/gui/app/pods/customize/auth/template.hbs b/gui/app/pods/customize/auth/template.hbs index 373556f9..cb09180f 100644 --- a/gui/app/pods/customize/auth/template.hbs +++ b/gui/app/pods/customize/auth/template.hbs @@ -1,6 +1,6 @@ {{layout/logo-heading title="Authentication" - desc="Choose user authentication provider — Documize, Redhat Keycloak, LDAP/AD, CAS" + desc="Choose user authentication provider — Documize, Redhat Keycloak, LDAP/AD, Central Authentication Server" icon=constants.Icon.Locked}} {{customize/auth-settings diff --git a/gui/app/templates/components/customize/auth-settings.hbs b/gui/app/templates/components/customize/auth-settings.hbs index 719bb121..c1273f6d 100644 --- a/gui/app/templates/components/customize/auth-settings.hbs +++ b/gui/app/templates/components/customize/auth-settings.hbs @@ -18,14 +18,14 @@